From b41bc3bb7d0273ec7db608f7a0ddcff0e176f823 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 20 Mar 2024 10:28:58 +0100 Subject: [PATCH] Updated message description depending on conference info state (cancelled, updated, etc...) --- .../java/org/linphone/utils/LinphoneUtils.kt | 34 ++++++++++++++++--- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/linphone/utils/LinphoneUtils.kt b/app/src/main/java/org/linphone/utils/LinphoneUtils.kt index 81c0ad02d..2c2289719 100644 --- a/app/src/main/java/org/linphone/utils/LinphoneUtils.kt +++ b/app/src/main/java/org/linphone/utils/LinphoneUtils.kt @@ -334,10 +334,36 @@ class LinphoneUtils { val conferenceInfo = Factory.instance().createConferenceInfoFromIcalendarContent( firstContent ) - text = AppUtils.getFormattedString( - R.string.message_meeting_invitation_content_description, - conferenceInfo?.subject.orEmpty() - ) + if (conferenceInfo != null) { + val subject = conferenceInfo.subject.orEmpty() + text = when (conferenceInfo.state) { + ConferenceInfo.State.Cancelled -> { + AppUtils.getFormattedString( + R.string.message_meeting_invitation_cancelled_content_description, + subject + ) + } + + ConferenceInfo.State.Updated -> { + AppUtils.getFormattedString( + R.string.message_meeting_invitation_updated_content_description, + subject + ) + } + + else -> { + AppUtils.getFormattedString( + R.string.message_meeting_invitation_content_description, + subject + ) + } + } + } else { + Log.e( + "$TAG Failed to parse content with iCalendar content type as conference info!" + ) + text = firstContent.name.orEmpty() + } } else if (firstContent?.isVoiceRecording == true) { text = AppUtils.getString(R.string.message_voice_message_content_description) } else {