mirror of
https://github.com/element-hq/element-android
synced 2024-11-23 18:05:36 +03:00
Do not check push rule on initial sync
This commit is contained in:
parent
b0ad568df0
commit
e838794587
1 changed files with 3 additions and 0 deletions
|
@ -22,6 +22,7 @@ import im.vector.matrix.android.internal.database.RealmLiveEntityObserver
|
|||
import im.vector.matrix.android.internal.database.mapper.asDomain
|
||||
import im.vector.matrix.android.internal.database.model.EventEntity
|
||||
import im.vector.matrix.android.internal.database.query.types
|
||||
import im.vector.matrix.android.internal.session.sync.SyncTokenStore
|
||||
import im.vector.matrix.android.internal.task.TaskExecutor
|
||||
import im.vector.matrix.android.internal.task.configureWith
|
||||
import javax.inject.Inject
|
||||
|
@ -31,6 +32,7 @@ internal class BingRuleWatcher @Inject constructor(monarchy: Monarchy,
|
|||
private val task: ProcessEventForPushTask,
|
||||
private val defaultPushRuleService: DefaultPushRuleService,
|
||||
private val sessionParams: SessionParams,
|
||||
private val tokenStore: SyncTokenStore,
|
||||
private val taskExecutor: TaskExecutor) :
|
||||
RealmLiveEntityObserver<EventEntity>(monarchy) {
|
||||
|
||||
|
@ -45,6 +47,7 @@ internal class BingRuleWatcher @Inject constructor(monarchy: Monarchy,
|
|||
}
|
||||
|
||||
override fun processChanges(inserted: List<EventEntity>, updated: List<EventEntity>, deleted: List<EventEntity>) {
|
||||
if (tokenStore.getLastToken() == null) return //no notif on initial sync
|
||||
// TODO Use const for "global"
|
||||
val rules = defaultPushRuleService.getPushRules("global")
|
||||
inserted.map { it.asDomain() }
|
||||
|
|
Loading…
Reference in a new issue