Merge branch 'develop' into feature/dagger

This commit is contained in:
ganfra
2019-06-27 18:56:23 +02:00
120 changed files with 3914 additions and 3977 deletions

View File

@ -61,4 +61,6 @@ interface PushersService {
}
fun livePushers(): LiveData<List<Pusher>>
fun pushers() : List<Pusher>
}

View File

@ -191,5 +191,4 @@ internal class DefaultSession @Inject constructor(override val sessionParams: Se
}
}
}

View File

@ -37,12 +37,15 @@ internal class BingRuleWatcher @Inject constructor(monarchy: Monarchy,
override val query = Monarchy.Query<EventEntity> {
EventEntity.types(it, listOf(
EventType.REDACTION, EventType.MESSAGE, EventType.REDACTION, EventType.ENCRYPTED)
EventType.MESSAGE,
EventType.REDACTION,
EventType.ENCRYPTED)
)
}
override fun processChanges(inserted: List<EventEntity>, updated: List<EventEntity>, deleted: List<EventEntity>) {
// TODO Use const for "global"
val rules = defaultPushRuleService.getPushRules("global")
inserted.map { it.asDomain() }
.filter { it.senderId != sessionParams.credentials.userId }

View File

@ -112,4 +112,8 @@ internal class DefaultPusherService @Inject constructor(
{ it.asDomain() }
)
}
override fun pushers(): List<Pusher> {
return monarchy.fetchAllCopiedSync { PusherEntity.where(it, sessionParam.credentials.userId) }.map { it.asDomain() }
}
}