From cd56030c416dfeda4bc3bf68c8582a96c849d636 Mon Sep 17 00:00:00 2001 From: Christophe Deschamps Date: Mon, 19 Sep 2022 15:17:37 +0200 Subject: [PATCH] Display a message when attempting to launch cancelled conference from history --- Classes/HistoryListTableView.m | 4 +++- .../Voip/ViewModels/ConferenceViewModel.swift | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Classes/HistoryListTableView.m b/Classes/HistoryListTableView.m index 8bf3ce518..b572b55a6 100644 --- a/Classes/HistoryListTableView.m +++ b/Classes/HistoryListTableView.m @@ -268,8 +268,10 @@ } else { if (linphone_call_log_was_conference(callLog)) { LinphoneConferenceInfo *confInfo = linphone_call_log_get_conference_info(callLog); - if (linphone_conference_info_get_state(confInfo) == LinphoneConferenceInfoStateCancelled) + if (linphone_conference_info_get_state(confInfo) == LinphoneConferenceInfoStateCancelled) { + [ConferenceViewModelBridge showCancelledMeetingWithCConferenceInfo:confInfo]; return; + } ConferenceWaitingRoomFragment *view = VIEW(ConferenceWaitingRoomFragment); [view setDetailsWithSubject:[NSString stringWithUTF8String:linphone_conference_info_get_subject(confInfo)] url:[NSString stringWithUTF8String:linphone_address_as_string(linphone_conference_info_get_uri(confInfo))]]; [PhoneMainView.instance changeCurrentView:ConferenceWaitingRoomFragment.compositeViewDescription]; diff --git a/Classes/Swift/Voip/ViewModels/ConferenceViewModel.swift b/Classes/Swift/Voip/ViewModels/ConferenceViewModel.swift index 55fdc9158..c503a603f 100644 --- a/Classes/Swift/Voip/ViewModels/ConferenceViewModel.swift +++ b/Classes/Swift/Voip/ViewModels/ConferenceViewModel.swift @@ -483,6 +483,21 @@ class ConferenceViewModel { ConferenceViewModel.shared.conferenceScheduler?.info = conferenceInfo // Will trigger the conference creation automatically } + @objc static func showCancelledMeeting(cConferenceInfo: OpaquePointer) { + let core = Core.get() + var message = VoipTexts.conference_scheduled_cancelled_by_organizer + let conferenceInfo = ConferenceInfo.getSwiftObject(cObject: cConferenceInfo) + if let organizerAddress = conferenceInfo.organizer { + let localAccount = Core.get().accountList.filter { account in + account.params?.identityAddress != nil && organizerAddress.weakEqual(address2: account.params!.identityAddress!) + }.first + if (localAccount != nil) { + message = VoipTexts.conference_scheduled_cancelled_by_me + } + } + VoipDialog.toast(message: message) + } + }