refactor: compact polling and usage based polling

This commit is contained in:
jubb
2021-04-30 16:53:53 +10:00
parent 460babe930
commit 7e14a315b9
4 changed files with 126 additions and 72 deletions

View File

@@ -54,7 +54,7 @@ class PublicChatManager(private val context: Context) {
if (!pollers.containsKey(threadId)) { pollers[threadId] = poller }
}
for ((threadId, chat) in v2Chats) {
val poller = v2Pollers[threadId] ?: OpenGroupV2Poller(chat, executorService)
val poller = v2Pollers[threadId] ?: OpenGroupV2Poller(listOf(chat), executorService)
poller.startIfNeeded()
listenToThreadDeletion(threadId)
if (!v2Pollers.containsKey(threadId)) { v2Pollers[threadId] = poller }