diff --git a/CHANGELOG.md b/CHANGELOG.md index c1f22f4e7..ed7014eae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ Group changes to describe their impact on the project, as follows: - one to hide contacts that have neither a SIP address nor a phone number - one to let app auto-answer call with video sending already enabled - one to let edit native contacts Linphone copy in-app instead of opening native addressbook third party app + - one to show past meetings (they are now hidden by default) - Added a vu meter for recording & playback volumes (must be enabled in developer settings) - Added support for HDMI audio devices - Added video preview during in-call conversation diff --git a/app/src/main/java/org/linphone/core/CorePreferences.kt b/app/src/main/java/org/linphone/core/CorePreferences.kt index a7c7deffe..4fa3a5e0f 100644 --- a/app/src/main/java/org/linphone/core/CorePreferences.kt +++ b/app/src/main/java/org/linphone/core/CorePreferences.kt @@ -230,6 +230,13 @@ class CorePreferences config.setBool("app", "create_e2e_encrypted_conferences", value) } + @get:AnyThread @set:WorkerThread + var showPastMeetings: Boolean + get() = config.getBool("ui", "show_past_meetings", false) + set(value) { + config.setBool("ui", "show_past_meetings", value) + } + // Contacts related @get:AnyThread @set:WorkerThread diff --git a/app/src/main/java/org/linphone/ui/main/meetings/viewmodel/MeetingsListViewModel.kt b/app/src/main/java/org/linphone/ui/main/meetings/viewmodel/MeetingsListViewModel.kt index d82254146..00ac002a8 100644 --- a/app/src/main/java/org/linphone/ui/main/meetings/viewmodel/MeetingsListViewModel.kt +++ b/app/src/main/java/org/linphone/ui/main/meetings/viewmodel/MeetingsListViewModel.kt @@ -23,6 +23,7 @@ import androidx.annotation.UiThread import androidx.annotation.WorkerThread import androidx.lifecycle.MutableLiveData import org.linphone.LinphoneApplication.Companion.coreContext +import org.linphone.LinphoneApplication.Companion.corePreferences import org.linphone.core.Account import org.linphone.core.AccountListenerStub import org.linphone.core.ConferenceInfo @@ -114,6 +115,9 @@ class MeetingsListViewModel fetchInProgress.postValue(true) } + val showPastMeetings = corePreferences.showPastMeetings + val nowInSecs = System.currentTimeMillis() / 1000 + val sortedSource = source.toList().sortedBy { it.dateTime } @@ -135,6 +139,14 @@ class MeetingsListViewModel ) continue } // This isn't a scheduled conference, don't display it + + if (!showPastMeetings && (info.dateTime + (info.duration * 60) < nowInSecs)) { + Log.d( + "$TAG Skipping conference info [${info.subject}] with uri [${info.uri?.asStringUriOnly()}] because it's in the past" + ) + continue + } + val add = if (filter.isNotEmpty()) { val organizerCheck = info.organizer?.asStringUriOnly()?.contains( filter, diff --git a/app/src/main/java/org/linphone/ui/main/settings/fragment/SettingsFragment.kt b/app/src/main/java/org/linphone/ui/main/settings/fragment/SettingsFragment.kt index e862a7602..2bb045f7b 100644 --- a/app/src/main/java/org/linphone/ui/main/settings/fragment/SettingsFragment.kt +++ b/app/src/main/java/org/linphone/ui/main/settings/fragment/SettingsFragment.kt @@ -325,6 +325,12 @@ class SettingsFragment : GenericMainFragment() { binding.tunnelSettings.tunnelModeSpinner.setSelection(index) } + viewModel.forceRefreshMeetingsListEvent.observe(viewLifecycleOwner) { + it.consume { + sharedViewModel.forceRefreshMeetingsListEvent.postValue(Event(true)) + } + } + binding.setTurnOnVfsClickListener { showConfirmVfsDialog() } diff --git a/app/src/main/java/org/linphone/ui/main/settings/viewmodel/SettingsViewModel.kt b/app/src/main/java/org/linphone/ui/main/settings/viewmodel/SettingsViewModel.kt index 6a85ee4ec..fc8bd0be0 100644 --- a/app/src/main/java/org/linphone/ui/main/settings/viewmodel/SettingsViewModel.kt +++ b/app/src/main/java/org/linphone/ui/main/settings/viewmodel/SettingsViewModel.kt @@ -140,6 +140,11 @@ class SettingsViewModel // Meetings settings val showMeetingsSettings = MutableLiveData() + val showPastMeetings = MutableLiveData() + val forceRefreshMeetingsListEvent: MutableLiveData> by lazy { + MutableLiveData>() + } + val defaultLayout = MutableLiveData() val availableLayoutsNames = arrayListOf( AppUtils.getString(R.string.settings_meetings_layout_active_speaker_label), @@ -348,6 +353,7 @@ class SettingsViewModel hideEmptyContacts.postValue(corePreferences.hideContactsWithoutPhoneNumberOrSipAddress) presenceSubscribe.postValue(core.isFriendListSubscriptionEnabled) + showPastMeetings.postValue(corePreferences.showPastMeetings) defaultLayout.postValue(core.defaultConferenceLayout.toInt()) autoShowDialpad.postValue(corePreferences.automaticallyShowDialpad) @@ -663,6 +669,16 @@ class SettingsViewModel expandMeetings.value = expandMeetings.value == false } + @UiThread + fun toggleShowPastMeetings() { + val newValue = showPastMeetings.value == false + coreContext.postOnCoreThread { + corePreferences.showPastMeetings = newValue + showPastMeetings.postValue(newValue) + forceRefreshMeetingsListEvent.postValue(Event(true)) + } + } + @UiThread fun setDefaultLayout(layoutValue: Int) { coreContext.postOnCoreThread { core -> diff --git a/app/src/main/res/layout/settings_meetings.xml b/app/src/main/res/layout/settings_meetings.xml index 302661e2b..e9697f846 100644 --- a/app/src/main/res/layout/settings_meetings.xml +++ b/app/src/main/res/layout/settings_meetings.xml @@ -16,6 +16,35 @@ android:paddingBottom="20dp" android:background="@drawable/shape_squircle_white_background"> + + + + diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 455ece602..9ca7d36f2 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -265,6 +265,7 @@ Une erreur s\'est produite, la configuration LDAP n\'a pas été sauvegardée ! Tous les champs doivent être remplis Réunions + Afficher les réunions passées Disposition par défaut Intervenant actif Mosaïque diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b6e1a08b5..14da32a7c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -307,6 +307,7 @@ A error occurred, LDAP server not saved! All fields must be filled Meetings + Show past meetings Default layout Active speaker Mosaic