diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index 540c3b9a9..a8639ac0f 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -238,6 +238,7 @@ intentIdentifiers:[[NSMutableArray alloc] init] options:UNNotificationCategoryOptionCustomDismissAction]; // Msg category + /* UNTextInputNotificationAction *act_reply = [UNTextInputNotificationAction actionWithIdentifier:@"Reply" title:NSLocalizedString(@"Reply", nil) @@ -251,7 +252,8 @@ actions:[NSArray arrayWithObjects:act_reply, act_seen, nil] intentIdentifiers:[[NSMutableArray alloc] init] options:UNNotificationCategoryOptionCustomDismissAction]; - + */ + // Video Request Category UNNotificationAction *act_accept = [UNNotificationAction actionWithIdentifier:@"Accept" @@ -282,7 +284,9 @@ options:UNNotificationCategoryOptionCustomDismissAction]; [UNUserNotificationCenter currentNotificationCenter].delegate = self; - NSSet *categories = [NSSet setWithObjects:cat_call, cat_msg, video_call, cat_zrtp, nil]; + //NSSet *categories = [NSSet setWithObjects:cat_call, cat_msg, video_call, cat_zrtp, nil]; + NSSet *categories = [NSSet setWithObjects:cat_call + , video_call, cat_zrtp, nil]; [[UNUserNotificationCenter currentNotificationCenter] setNotificationCategories:categories]; } diff --git a/Classes/Swift/Chat/ViewModels/ChatConversationViewModel.swift b/Classes/Swift/Chat/ViewModels/ChatConversationViewModel.swift index 917ace658..83bc46d40 100644 --- a/Classes/Swift/Chat/ViewModels/ChatConversationViewModel.swift +++ b/Classes/Swift/Chat/ViewModels/ChatConversationViewModel.swift @@ -67,7 +67,7 @@ class ChatConversationViewModel { var mediaCollectionView : [UIImage] = [] var replyCollectionView : [UIImage] = [] - var isComposing = MutableLiveData(false) + var isComposing = MutableLiveData(0) var messageReceived = MutableLiveData() var stateChanged = MutableLiveData() var secureLevelChanged = MutableLiveData() @@ -132,7 +132,7 @@ class ChatConversationViewModel { } func on_chat_room_is_composing_received(_ cr: ChatRoom?, _ remoteAddr: Address?, _ isComposingBool: Bool) { - isComposing.value = (linphone_chat_room_is_remote_composing(cr?.getCobject) != 0) || bctbx_list_size(linphone_chat_room_get_composing_addresses(cr?.getCobject)) > 0 + isComposing.value = bctbx_list_size(linphone_chat_room_get_composing_addresses(cr?.getCobject)) } func on_chat_room_chat_message_received(_ cr: ChatRoom?, _ event_log: EventLog?) { diff --git a/Classes/Swift/Chat/Views/ChatConversationViewSwift.swift b/Classes/Swift/Chat/Views/ChatConversationViewSwift.swift index 4005416a6..0a276730d 100644 --- a/Classes/Swift/Chat/Views/ChatConversationViewSwift.swift +++ b/Classes/Swift/Chat/Views/ChatConversationViewSwift.swift @@ -176,9 +176,13 @@ class ChatConversationViewSwift: BackActionsNavigationView, PHPickerViewControll contentMessageView.floatingButton.addTarget(self, action: #selector(self.alertActionGoToDevicesList), for: .touchUpInside) ChatConversationViewModel.sharedModel.isComposing.observe { compose in - if((compose! && self.contentMessageView.isComposingView.isHidden)||(!compose! && !self.contentMessageView.isComposingView.isHidden)){ + /* + if((compose! > 0 && self.contentMessageView.isComposingView.isHidden)||(compose! == 0 && !self.contentMessageView.isComposingView.isHidden)){ + print("on_chat_room_is_composing_received isComposing \(compose)") self.setComposingVisible(compose!, withDelay: 0.3) } + */ + self.setComposingVisible(compose!, withDelay: 0.3) } ChatConversationViewModel.sharedModel.messageReceived.observe { message in @@ -810,7 +814,7 @@ class ChatConversationViewSwift: BackActionsNavigationView, PHPickerViewControll } else { contentMessageView.messageView.messageText.text = "" } - contentMessageView.messageView.emojisButton.isHidden = false + contentMessageView.messageView.emojisButton.isHidden = true contentMessageView.messageView.isComposing = false } setSendButtonState() @@ -890,10 +894,10 @@ class ChatConversationViewSwift: BackActionsNavigationView, PHPickerViewControll if fileTransfer.text.isEmpty && !contentMessageView.messageView.messageText.isFirstResponder{ contentMessageView.messageView.messageText.textColor = UIColor.lightGray contentMessageView.messageView.messageText.text = "Message" - contentMessageView.messageView.emojisButton.isHidden = false + contentMessageView.messageView.emojisButton.isHidden = true } else { contentMessageView.messageView.messageText.text = "" - contentMessageView.messageView.emojisButton.isHidden = false + contentMessageView.messageView.emojisButton.isHidden = true } contentMessageView.messageView.sendButton.isEnabled = false @@ -917,8 +921,9 @@ class ChatConversationViewSwift: BackActionsNavigationView, PHPickerViewControll tableControllerSwift.refreshData(isOutgoing: true) } - func setComposingVisible(_ visible: Bool, withDelay delay: CGFloat) { - if visible { + func setComposingVisible(_ visible: Int, withDelay delay: CGFloat) { + print("setComposingVisiblesetComposingVisible \(ChatConversationViewModel.sharedModel.chatRoom!.composingAddresses.count)") + if visible > 0 { let addresses = ChatConversationViewModel.sharedModel.chatRoom!.composingAddresses var composingAddresses : String? = "" if addresses.count == 1 { @@ -935,9 +940,15 @@ class ChatConversationViewSwift: BackActionsNavigationView, PHPickerViewControll contentMessageView.isComposingTextView.text = String.localizedStringWithFormat(NSLocalizedString("%@ are writing...", comment: ""), composingAddresses!) } } - UIView.animate(withDuration: 0.3, animations: { - self.contentMessageView.isComposingView.isHidden = !self.contentMessageView.isComposingView.isHidden - }) + if visible == 0 { + UIView.animate(withDuration: 0.3, animations: { + self.contentMessageView.isComposingView.isHidden = true + }) + } else { + UIView.animate(withDuration: 0.3, animations: { + self.contentMessageView.isComposingView.isHidden = false + }) + } } func selectionMedia() { diff --git a/Classes/Swift/Chat/Views/MultilineMessageCell.swift b/Classes/Swift/Chat/Views/MultilineMessageCell.swift index 006a01a0e..d9da508d0 100644 --- a/Classes/Swift/Chat/Views/MultilineMessageCell.swift +++ b/Classes/Swift/Chat/Views/MultilineMessageCell.swift @@ -2172,6 +2172,11 @@ class MultilineMessageCell: SwipeCollectionViewCell, UICollectionViewDataSource, ChatConversationTableViewModel.sharedModel.reloadCollectionViewCell() indexTransferProgress = -1 } + + if !VFSUtil.vfsEnabled(groupName: kLinphoneMsgNotificationAppGroupId) && ConfigManager.instance().lpConfigBoolForKey(key: "auto_write_to_gallery_preference") { + ChatConversationViewModel.sharedModel.writeMediaToGalleryFromName(content.name, fileType: content.type) + } + } else { if (indexTransferProgress > -1 && downloadContentCollection[indexTransferProgress] != nil && indexTransferProgress > -1) { downloadContentCollection[indexTransferProgress]!.setUpCircularProgressBarView(toValue: p)