mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 19:18:06 +00:00
Fix notification click redirection to chatroom
This commit is contained in:
parent
db24bd842f
commit
56f732144d
2 changed files with 15 additions and 8 deletions
|
|
@ -28,6 +28,8 @@ struct ConversationFragment: View {
|
|||
@State private var orientation = UIDevice.current.orientation
|
||||
private var idiom: UIUserInterfaceIdiom { UIDevice.current.userInterfaceIdiom }
|
||||
|
||||
@EnvironmentObject var navigationManager: NavigationManager
|
||||
|
||||
@ObservedObject var contactsManager = ContactsManager.shared
|
||||
@ObservedObject private var sharedMainViewModel = SharedMainViewModel.shared
|
||||
|
||||
|
|
@ -165,7 +167,9 @@ struct ConversationFragment: View {
|
|||
}
|
||||
.onChange(of: scenePhase) { newPhase in
|
||||
if newPhase == .active {
|
||||
conversationViewModel.resetDisplayedChatRoom()
|
||||
if conversationViewModel.displayedConversation != nil && (navigationManager.peerAddr == nil || navigationManager.peerAddr!.contains(conversationViewModel.displayedConversation!.remoteSipUri)) {
|
||||
conversationViewModel.resetDisplayedChatRoom()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1777,18 +1777,21 @@ class ConversationViewModel: ObservableObject {
|
|||
self.selectedMessage = nil
|
||||
self.resetMessage()
|
||||
self.removeConversationDelegate()
|
||||
withAnimation {
|
||||
self.displayedConversation = conversationModel
|
||||
}
|
||||
|
||||
CoreContext.shared.doOnCoreQueue { core in
|
||||
let nilParams: ConferenceParams? = nil
|
||||
if let newChatRoom = core.searchChatRoom(params: nilParams, localAddr: nil, remoteAddr: conversationModel.chatRoom.peerAddress, participants: nil) {
|
||||
self.addConversationDelegate(chatRoom: newChatRoom)
|
||||
if LinphoneUtils.getChatRoomId(room: newChatRoom) == conversationModel.id {
|
||||
self.addConversationDelegate(chatRoom: newChatRoom)
|
||||
let conversation = ConversationModel(chatRoom: newChatRoom)
|
||||
DispatchQueue.main.async {
|
||||
withAnimation {
|
||||
self.displayedConversation = conversation
|
||||
}
|
||||
self.getMessages()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self.getMessages()
|
||||
}
|
||||
|
||||
func resetDisplayedChatRoom() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue