mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-04-23 16:48:32 +00:00
Add isReadOnly check to hide views (messageView, callButton, ...)
This commit is contained in:
parent
f373067247
commit
8a4f1046c6
1 changed files with 32 additions and 4 deletions
|
|
@ -216,6 +216,10 @@ import AVFoundation
|
||||||
chatRoom?.addDelegate(delegate: chatRoomDelegate!)
|
chatRoom?.addDelegate(delegate: chatRoomDelegate!)
|
||||||
tableController.tableView.separatorColor = .clear
|
tableController.tableView.separatorColor = .clear
|
||||||
|
|
||||||
|
if !chatRoom!.isReadOnly {
|
||||||
|
messageView.ephemeralIndicator.isHidden = (linphone_chat_room_ephemeral_enabled(chatRoom?.getCobject) == 0)
|
||||||
|
}
|
||||||
|
|
||||||
workItem = DispatchWorkItem {
|
workItem = DispatchWorkItem {
|
||||||
let indexPath = IndexPath(row: self.mediaCollectionView.count, section: 0)
|
let indexPath = IndexPath(row: self.mediaCollectionView.count, section: 0)
|
||||||
self.mediaURLCollection.append(self.urlFile[indexPath.row]!)
|
self.mediaURLCollection.append(self.urlFile[indexPath.row]!)
|
||||||
|
|
@ -236,6 +240,7 @@ import AVFoundation
|
||||||
}
|
}
|
||||||
|
|
||||||
self.handlePendingTransferIfAny()
|
self.handlePendingTransferIfAny()
|
||||||
|
configureMessageField()
|
||||||
self.shareFile()
|
self.shareFile()
|
||||||
|
|
||||||
initSharedPlayer()
|
initSharedPlayer()
|
||||||
|
|
@ -447,7 +452,9 @@ import AVFoundation
|
||||||
menu.dataSource.removeAll()
|
menu.dataSource.removeAll()
|
||||||
|
|
||||||
if(groupeChat){
|
if(groupeChat){
|
||||||
|
if !chatRoom!.isReadOnly {
|
||||||
menu.dataSource.append(VoipTexts.conference_schedule_start)
|
menu.dataSource.append(VoipTexts.conference_schedule_start)
|
||||||
|
}
|
||||||
menu.dataSource.append(VoipTexts.dropdown_menu_chat_conversation_group_infos)
|
menu.dataSource.append(VoipTexts.dropdown_menu_chat_conversation_group_infos)
|
||||||
}else{
|
}else{
|
||||||
var contact: Contact? = nil
|
var contact: Contact? = nil
|
||||||
|
|
@ -464,8 +471,10 @@ import AVFoundation
|
||||||
}
|
}
|
||||||
if(secureLevel){
|
if(secureLevel){
|
||||||
menu.dataSource.append(VoipTexts.dropdown_menu_chat_conversation_conversation_device)
|
menu.dataSource.append(VoipTexts.dropdown_menu_chat_conversation_conversation_device)
|
||||||
|
if !chatRoom!.isReadOnly {
|
||||||
menu.dataSource.append(VoipTexts.dropdown_menu_chat_conversation_ephemeral_messages)
|
menu.dataSource.append(VoipTexts.dropdown_menu_chat_conversation_ephemeral_messages)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if(LinphoneManager.getChatroomPushEnabled(chatRoom?.getCobject)){
|
if(LinphoneManager.getChatroomPushEnabled(chatRoom?.getCobject)){
|
||||||
menu.dataSource.append(VoipTexts.dropdown_menu_chat_conversation_mute_notifications)
|
menu.dataSource.append(VoipTexts.dropdown_menu_chat_conversation_mute_notifications)
|
||||||
}else{
|
}else{
|
||||||
|
|
@ -473,8 +482,10 @@ import AVFoundation
|
||||||
}
|
}
|
||||||
menu.dataSource.append(VoipTexts.dropdown_menu_chat_conversation_delete_messages)
|
menu.dataSource.append(VoipTexts.dropdown_menu_chat_conversation_delete_messages)
|
||||||
|
|
||||||
|
if !chatRoom!.isReadOnly {
|
||||||
messageView.ephemeralIndicator.isHidden = (linphone_chat_room_ephemeral_enabled(chatRoom?.getCobject) == 0)
|
messageView.ephemeralIndicator.isHidden = (linphone_chat_room_ephemeral_enabled(chatRoom?.getCobject) == 0)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@objc func initChatRoom(cChatRoom:OpaquePointer) {
|
@objc func initChatRoom(cChatRoom:OpaquePointer) {
|
||||||
chatRoom = ChatRoom.getSwiftObject(cObject: cChatRoom)
|
chatRoom = ChatRoom.getSwiftObject(cObject: cChatRoom)
|
||||||
|
|
@ -510,8 +521,13 @@ import AVFoundation
|
||||||
}
|
}
|
||||||
|
|
||||||
changeTitle(titleString: address ?? "Error")
|
changeTitle(titleString: address ?? "Error")
|
||||||
changeCallIcon(groupChat: changeIcon)
|
|
||||||
|
|
||||||
|
if !chatRoom!.isReadOnly{
|
||||||
|
changeCallIcon(groupChat: changeIcon)
|
||||||
|
}else{
|
||||||
|
action1Button.isHidden = true
|
||||||
|
action1BisButton.isHidden = true
|
||||||
|
}
|
||||||
let secureLevel = FastAddressBook.image(for: linphone_chat_room_get_security_level(cChatRoom))
|
let secureLevel = FastAddressBook.image(for: linphone_chat_room_get_security_level(cChatRoom))
|
||||||
changeSecureLevel(secureLevel: secureLevel != nil, imageBadge: secureLevel)
|
changeSecureLevel(secureLevel: secureLevel != nil, imageBadge: secureLevel)
|
||||||
initDataSource(groupeChat: !isOneToOneChat, secureLevel: secureLevel != nil, cChatRoom: cChatRoom)
|
initDataSource(groupeChat: !isOneToOneChat, secureLevel: secureLevel != nil, cChatRoom: cChatRoom)
|
||||||
|
|
@ -1841,4 +1857,16 @@ import AVFoundation
|
||||||
linphone_player_open(linphonePlayer?.getCobject, path)
|
linphone_player_open(linphonePlayer?.getCobject, path)
|
||||||
linphone_player_start(linphonePlayer?.getCobject)
|
linphone_player_start(linphonePlayer?.getCobject)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func configureMessageField() {
|
||||||
|
let isOneToOneChat = chatRoom!.hasCapability(mask: Int(LinphoneChatRoomCapabilitiesOneToOne.rawValue))
|
||||||
|
if isOneToOneChat {
|
||||||
|
messageView.isHidden = false
|
||||||
|
if chatRoom!.isReadOnly {
|
||||||
|
chatRoom!.addParticipant(addr: (chatRoom?.me?.address)!)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
messageView.isHidden = chatRoom!.isReadOnly
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue