Don't show notification for active conversation, improve messaging performance

Previously, the app would mark the conversation read every time a message was received. Now, when we're receiving a message, we can see which conversation is open (if any), and mark it read during the inital write. Now we don't need to query and do another transaction for marking read
This commit is contained in:
Moez Bhatti
2018-09-05 17:51:53 -04:00
parent 8c01ef6612
commit 957a1ad1d4
7 changed files with 71 additions and 18 deletions
@@ -0,0 +1,14 @@
package com.moez.QKSMS.manager
/**
* Keeps track of the conversation that the user is currently viewing. This is useful when we
* receive a message, because it allows us to immediately mark the message read and not display
* a notification
*/
interface ActiveConversationManager {
fun setActiveConversation(threadId: Long?)
fun getActiveConversation(): Long?
}