diff --git a/app/src/main/java/org/linphone/ui/main/history/viewmodel/HistoryListViewModel.kt b/app/src/main/java/org/linphone/ui/main/history/viewmodel/HistoryListViewModel.kt index 873736ee9..422996ffd 100644 --- a/app/src/main/java/org/linphone/ui/main/history/viewmodel/HistoryListViewModel.kt +++ b/app/src/main/java/org/linphone/ui/main/history/viewmodel/HistoryListViewModel.kt @@ -106,13 +106,16 @@ class HistoryListViewModel @UiThread fun removeAllCallLogs() { coreContext.postOnCoreThread { core -> - val account = LinphoneUtils.getDefaultAccount() - if (account != null) { - account.clearCallLogs() - } else { - for (callLog in core.callLogs) { - core.removeCallLog(callLog) + // TODO FIXME: remove workaround later + if (coreContext.core.accountList.size > 1) { + val account = LinphoneUtils.getDefaultAccount() + if (account != null) { + account.clearCallLogs() + } else { + core.clearCallLogs() } + } else { + core.clearCallLogs() } historyDeletedEvent.postValue(Event(true)) @@ -143,6 +146,7 @@ class HistoryListViewModel val account = LinphoneUtils.getDefaultAccount() // Fetch all call logs if only one account to workaround no history issue + // TODO FIXME: remove workaround later val logs = if (coreContext.core.accountList.size > 1) { account?.callLogs ?: coreContext.core.callLogs } else { diff --git a/app/src/main/java/org/linphone/ui/main/history/viewmodel/HistoryViewModel.kt b/app/src/main/java/org/linphone/ui/main/history/viewmodel/HistoryViewModel.kt index 05af48bdd..6f96dda67 100644 --- a/app/src/main/java/org/linphone/ui/main/history/viewmodel/HistoryViewModel.kt +++ b/app/src/main/java/org/linphone/ui/main/history/viewmodel/HistoryViewModel.kt @@ -331,6 +331,7 @@ class HistoryViewModel } // Required when "unique account displays all call logs from Core" workaround + // TODO FIXME: remove workaround later if (list.isEmpty()) { for (log in coreContext.core.callLogs) { if (log.remoteAddress.weakEqual(address)) {