forked from mirrors/linphone-iphone
Fix screenshot secure mode
Check if linphone_friend_get_address is not nil in ChatConversationCreateTableView
This commit is contained in:
parent
f1b69a388d
commit
7ec518a114
2 changed files with 13 additions and 8 deletions
|
|
@ -105,7 +105,7 @@
|
|||
contact = [_ldapAndProvisioningContactAddressBookMap objectForKey:key];
|
||||
}
|
||||
|
||||
if (contact.friend != nil) {
|
||||
if (contact.friend != nil && linphone_friend_get_address(contact.friend) != nil) {
|
||||
char *curi = linphone_address_as_string_uri_only(linphone_friend_get_address(contact.friend));
|
||||
NSString *uri = [NSString stringWithUTF8String:curi];
|
||||
|
||||
|
|
|
|||
|
|
@ -153,6 +153,7 @@ class ChatConversationViewSwift: BackActionsNavigationView, PHPickerViewControll
|
|||
markAsRead = true
|
||||
|
||||
//PhoneMainView.instance()!.mainViewController.view.makeSecure(field: field)
|
||||
UIApplication.shared.keyWindow?.makeSecure(field: field)
|
||||
|
||||
NotificationCenter.default.addObserver(forName: UIApplication.userDidTakeScreenshotNotification, object: nil, queue: OperationQueue.main) { notification in
|
||||
if (ConfigManager.instance().lpConfigBoolForKey(key: "screenshot_preference") == false && self.floatingButton.isHidden == false) {
|
||||
|
|
@ -301,13 +302,15 @@ class ChatConversationViewSwift: BackActionsNavigationView, PHPickerViewControll
|
|||
configureMessageField()
|
||||
ChatConversationViewModel.sharedModel.shareFile()
|
||||
|
||||
/*
|
||||
if ConfigManager.instance().lpConfigBoolForKey(key: "screenshot_preference") == false && floatingButton.isHidden == false {
|
||||
PhoneMainView.instance()!.mainViewController.view.changeSecure(field: field, isSecure: true)
|
||||
}else{
|
||||
PhoneMainView.instance()!.mainViewController.view.changeSecure(field: field, isSecure: false)
|
||||
if UIApplication.shared.keyWindow != nil {
|
||||
if ConfigManager.instance().lpConfigBoolForKey(key: "screenshot_preference") == false && floatingButton.isHidden == false {
|
||||
//PhoneMainView.instance()!.mainViewController.view.changeSecure(field: field, isSecure: true)
|
||||
UIApplication.shared.keyWindow?.changeSecure(field: field, isSecure: true)
|
||||
}else{
|
||||
//PhoneMainView.instance()!.mainViewController.view.changeSecure(field: field, isSecure: false)
|
||||
UIApplication.shared.keyWindow?.changeSecure(field: field, isSecure: false)
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
override func viewWillDisappear(_ animated: Bool) {
|
||||
|
|
@ -317,6 +320,9 @@ class ChatConversationViewSwift: BackActionsNavigationView, PHPickerViewControll
|
|||
AvatarBridge.removeAllObserver()
|
||||
|
||||
//PhoneMainView.instance()!.mainViewController.view.changeSecure(field: field, isSecure: false)
|
||||
if UIApplication.shared.keyWindow != nil {
|
||||
UIApplication.shared.keyWindow?.changeSecure(field: field, isSecure: false)
|
||||
}
|
||||
}
|
||||
|
||||
override func viewDidDisappear(_ animated: Bool) {
|
||||
|
|
@ -578,7 +584,6 @@ class ChatConversationViewSwift: BackActionsNavigationView, PHPickerViewControll
|
|||
let secureLevel = FastAddressBook.image(for: linphone_chat_room_get_security_level(cChatRoom))
|
||||
changeSecureLevel(secureLevel: secureLevel != nil, imageBadge: secureLevel)
|
||||
initDataSource(groupeChat: !isOneToOneChat, secureLevel: secureLevel != nil, cChatRoom: cChatRoom)
|
||||
self.viewWillAppear(true)
|
||||
}
|
||||
|
||||
func updateParticipantLabel(){
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue