|
|
|
@ -35,6 +35,8 @@ class LokiPublicChatPoller(private val context: Context, private val group: Loki
|
|
|
|
|
private val handler = Handler()
|
|
|
|
|
private var hasStarted = false
|
|
|
|
|
|
|
|
|
|
private var isCatchUp = false
|
|
|
|
|
|
|
|
|
|
// region Convenience
|
|
|
|
|
private val userHexEncodedPublicKey = TextSecurePreferences.getLocalNumber(context)
|
|
|
|
|
private var displayNameUpdatees = setOf<String>()
|
|
|
|
@ -82,6 +84,14 @@ class LokiPublicChatPoller(private val context: Context, private val group: Loki
|
|
|
|
|
}
|
|
|
|
|
// endregion
|
|
|
|
|
|
|
|
|
|
fun isCatchUp(): Boolean {
|
|
|
|
|
return isCatchUp
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fun shouldCatchUp() {
|
|
|
|
|
isCatchUp = false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// region Settings
|
|
|
|
|
companion object {
|
|
|
|
|
private val pollForNewMessagesInterval: Long = 4 * 1000
|
|
|
|
@ -249,6 +259,7 @@ class LokiPublicChatPoller(private val context: Context, private val group: Loki
|
|
|
|
|
processIncomingMessage(message)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
isCatchUp = true
|
|
|
|
|
}.fail {
|
|
|
|
|
Log.d("Loki", "Failed to get messages for group chat with ID: ${group.channel} on server: ${group.server}.")
|
|
|
|
|
}
|
|
|
|
|