From 2abad0ab9a4cef2d04ce7ff2dc109140bc7422ed Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Thu, 20 Mar 2025 13:00:10 +0100 Subject: [PATCH] Fetch call history from Core instead of Account if only one of them --- .../ui/main/history/viewmodel/HistoryListViewModel.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 c5fd7304c..873736ee9 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 @@ -142,7 +142,13 @@ class HistoryListViewModel var count = 0 val account = LinphoneUtils.getDefaultAccount() - val logs = account?.callLogs ?: coreContext.core.callLogs + // Fetch all call logs if only one account to workaround no history issue + val logs = if (coreContext.core.accountList.size > 1) { + account?.callLogs ?: coreContext.core.callLogs + } else { + coreContext.core.callLogs + } + for (callLog in logs) { val model = CallLogModel(callLog) if (isCallLogMatchingFilter(model, filter)) {