mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 19:38:08 +00:00
Fixed remove all call logs when workaround is active
This commit is contained in:
parent
2aed404167
commit
6121cb41bf
2 changed files with 11 additions and 6 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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)) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue