mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-12 18:43:38 +00:00
Process public chat messages in a background thread and not the promise thread.
This commit is contained in:
parent
d7571d237a
commit
bdc0ed36eb
@ -25,6 +25,7 @@ import org.whispersystems.signalservice.api.push.SignalServiceAddress
|
|||||||
import org.whispersystems.signalservice.loki.api.LokiPublicChat
|
import org.whispersystems.signalservice.loki.api.LokiPublicChat
|
||||||
import org.whispersystems.signalservice.loki.api.LokiPublicChatAPI
|
import org.whispersystems.signalservice.loki.api.LokiPublicChatAPI
|
||||||
import org.whispersystems.signalservice.loki.api.LokiPublicChatMessage
|
import org.whispersystems.signalservice.loki.api.LokiPublicChatMessage
|
||||||
|
import org.whispersystems.signalservice.loki.utilities.successBackground
|
||||||
|
|
||||||
class LokiPublicChatPoller(private val context: Context, private val group: LokiPublicChat) {
|
class LokiPublicChatPoller(private val context: Context, private val group: LokiPublicChat) {
|
||||||
private val handler = Handler()
|
private val handler = Handler()
|
||||||
@ -197,7 +198,8 @@ class LokiPublicChatPoller(private val context: Context, private val group: Loki
|
|||||||
finalize()
|
finalize()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
api.getMessages(group.channel, group.server).success { messages ->
|
api.getMessages(group.channel, group.server).successBackground { messages ->
|
||||||
|
// Process messages in the background
|
||||||
messages.forEach { message ->
|
messages.forEach { message ->
|
||||||
if (message.hexEncodedPublicKey != userHexEncodedPublicKey) {
|
if (message.hexEncodedPublicKey != userHexEncodedPublicKey) {
|
||||||
processIncomingMessage(message)
|
processIncomingMessage(message)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user