- Made deleting of messages and chats safe.

This commit is contained in:
Juha Heinanen
2019-10-04 21:06:46 +03:00
parent 85eb19670f
commit 34bd5865c4
3 changed files with 8 additions and 2 deletions
@@ -31,6 +31,11 @@ class Message(val aor: String, val peerUri: String, val message: String, val tim
BaresipService.messages.removeAt(firstIndex)
}
fun clear(aor: String) {
val it = BaresipService.messages.iterator()
while (it.hasNext()) if (it.next().aor == aor) it.remove()
}
fun saveMessages() {
val file = File(BaresipService.filesPath, "messages")
try {