- Allow deletion of account's chat history via chats activity menu item.

- Ask confirmation before deleting chat and call history.
- Improved updating of main activity voicemail, chat, and call icons.
- Removed path parameter from saveUaMessage, deleteUaMessage, and
  saveMessages functions.
This commit is contained in:
Juha Heinanen
2019-10-03 20:50:23 +03:00
parent 04cf77a60f
commit 39a0230bd0
10 changed files with 95 additions and 69 deletions
@@ -173,6 +173,7 @@ class BaresipService: Service() {
}
ContactsActivity.restoreContacts(applicationContext.filesDir, "contacts")
Message.restoreMessages()
Thread(Runnable { baresipStart(filesPath) }).start()
isServiceRunning = true
@@ -261,8 +262,7 @@ class BaresipService: Service() {
Log.w(LOG_TAG, "onStartCommand did not find UA $uap")
else
ChatsActivity.saveUaMessage(ua.account.aor,
intent.getStringExtra("time").toLong(),
applicationContext.filesDir.absolutePath)
intent.getStringExtra("time").toLong())
nm.cancel(BaresipService.MESSAGE_NOTIFICATION_ID)
}
@@ -273,8 +273,7 @@ class BaresipService: Service() {
Log.w(LOG_TAG, "onStartCommand did not find UA $uap")
else
ChatsActivity.deleteUaMessage(ua.account.aor,
intent.getStringExtra("time").toLong(),
applicationContext.filesDir.absolutePath)
intent.getStringExtra("time").toLong())
nm.cancel(BaresipService.MESSAGE_NOTIFICATION_ID)
}
@@ -637,7 +636,7 @@ class BaresipService: Service() {
Log.d(LOG_TAG, "Message event for $uap from $peer at $timeStamp")
Message.add(Message(ua.account.aor, peer, text, timeStamp.toLong(),
R.drawable.arrow_down_green, 0, "", true))
Message.saveMessages(filesPath)
Message.saveMessages()
ua.account.unreadMessages = true
if (!Utils.isVisible()) {
val intent = Intent(this, BaresipService::class.java)