- Added Call History menu that allows deleting of account's call history

and disabling/enabling production of account's call history.
This commit is contained in:
Juha Heinanen
2019-09-30 17:58:40 +03:00
parent e5369e4b82
commit 0e8ba14deb
6 changed files with 89 additions and 22 deletions
@@ -30,12 +30,12 @@ class CallHistory(val aor: String, val peerURI: String, val direction: String,
}
}
fun clear(aor: String) {
BaresipService.history = ArrayList(BaresipService.history.filter{it.aor != aor})
}
fun aorHistorySize(aor: String): Int {
var size = 0;
for (h in BaresipService.history) {
if (h.aor == aor) size++
}
return size
return BaresipService.history.filter { it.aor == aor }.count()
}
fun aorLatestHistory(aor: String): CallHistory? {
@@ -75,6 +75,11 @@ class CallHistory(val aor: String, val peerURI: String, val direction: String,
}
}
fun print() {
for (h in BaresipService.history)
Log.d("Baresip", "[${h.aor}, ${h.peerURI}, ${h.direction}, ${h.connected}]")
}
}
}