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,19 @@
package com.moez.QKSMS.manager
import javax.inject.Inject
import javax.inject.Singleton
@Singleton
class ActiveConversationManagerImpl @Inject constructor() : ActiveConversationManager {
private var threadId: Long? = null
override fun setActiveConversation(threadId: Long?) {
this.threadId = threadId
}
override fun getActiveConversation(): Long? {
return threadId
}
}