mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-25 09:17:44 +00:00
commit
e005fbf282
@ -50,6 +50,8 @@ class BackgroundPollJob private constructor(parameters: Parameters) : BaseJob(pa
|
||||
Log.d("Loki", "Performing background poll.")
|
||||
val userPublicKey = TextSecurePreferences.getLocalNumber(context)
|
||||
val promises = mutableListOf<Promise<Unit, Exception>>()
|
||||
if (!TextSecurePreferences.isUsingFCM(context)) {
|
||||
Log.d("Loki", "Not using FCM, poll for contacts and closed groups.")
|
||||
val promise = SnodeAPI.shared.getMessages(userPublicKey).map { envelopes ->
|
||||
envelopes.forEach {
|
||||
PushContentReceiveJob(context).processEnvelope(SignalServiceEnvelope(it), false)
|
||||
@ -57,6 +59,7 @@ class BackgroundPollJob private constructor(parameters: Parameters) : BaseJob(pa
|
||||
}
|
||||
promises.add(promise)
|
||||
promises.addAll(ClosedGroupPoller.shared.pollOnce())
|
||||
}
|
||||
val openGroups = DatabaseFactory.getLokiThreadDatabase(context).getAllPublicChats().map { it.value }
|
||||
for (openGroup in openGroups) {
|
||||
val poller = PublicChatPoller(context, openGroup)
|
||||
|
Loading…
x
Reference in New Issue
Block a user