forked from GitHub-Mirror/riotX-android
rename method
This commit is contained in:
parent
9fa3a75fb6
commit
2625e11508
@ -20,14 +20,13 @@ import im.vector.matrix.android.api.session.events.model.Event
|
|||||||
|
|
||||||
interface PushRuleService {
|
interface PushRuleService {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch the push rules from the server
|
* Fetch the push rules from the server
|
||||||
*/
|
*/
|
||||||
fun fetchPushRules(scope: String = "global")
|
fun fetchPushRules(scope: String = "global")
|
||||||
|
|
||||||
//TODO get push rule set
|
//TODO get push rule set
|
||||||
fun getPushrules(scope: String = "global"): List<PushRule>
|
fun getPushRules(scope: String = "global"): List<PushRule>
|
||||||
|
|
||||||
//TODO update rule
|
//TODO update rule
|
||||||
|
|
||||||
|
@ -0,0 +1,20 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2019 New Vector Ltd
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package im.vector.matrix.android.api.pushrules
|
||||||
|
|
||||||
|
enum class RuleIds {
|
||||||
|
}
|
@ -503,8 +503,8 @@ internal class DefaultSession(override val sessionParams: SessionParams) : Sessi
|
|||||||
return pushersService.livePushers()
|
return pushersService.livePushers()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getPushrules(scope: String): List<PushRule> {
|
override fun getPushRules(scope: String): List<PushRule> {
|
||||||
return pushRuleService.getPushrules(scope)
|
return pushRuleService.getPushRules(scope)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun fetchPushRules(scope: String) {
|
override fun fetchPushRules(scope: String) {
|
||||||
|
@ -42,7 +42,7 @@ internal class BingRuleWatcher(monarchy: Monarchy,
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun processChanges(inserted: List<EventEntity>, updated: List<EventEntity>, deleted: List<EventEntity>) {
|
override fun processChanges(inserted: List<EventEntity>, updated: List<EventEntity>, deleted: List<EventEntity>) {
|
||||||
val rules = defaultPushRuleService.getPushrules("global")
|
val rules = defaultPushRuleService.getPushRules("global")
|
||||||
inserted.map { it.asDomain() }
|
inserted.map { it.asDomain() }
|
||||||
.filter { it.senderId != sessionParams.credentials.userId }
|
.filter { it.senderId != sessionParams.credentials.userId }
|
||||||
.let { events ->
|
.let { events ->
|
||||||
|
@ -103,7 +103,7 @@ internal class DefaultPushRuleService(
|
|||||||
.executeBy(taskExecutor)
|
.executeBy(taskExecutor)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getPushrules(scope: String): List<PushRule> {
|
override fun getPushRules(scope: String): List<PushRule> {
|
||||||
|
|
||||||
var contentRules: List<PushRule> = emptyList()
|
var contentRules: List<PushRule> = emptyList()
|
||||||
var overrideRules: List<PushRule> = emptyList()
|
var overrideRules: List<PushRule> = emptyList()
|
||||||
|
@ -34,7 +34,7 @@ class PushRulesViewModel(initialState: PushRulesViewState) : VectorViewModel<Pus
|
|||||||
|
|
||||||
override fun initialState(viewModelContext: ViewModelContext): PushRulesViewState? {
|
override fun initialState(viewModelContext: ViewModelContext): PushRulesViewState? {
|
||||||
val session = viewModelContext.activity.get<Session>()
|
val session = viewModelContext.activity.get<Session>()
|
||||||
val rules = session.getPushrules()
|
val rules = session.getPushRules()
|
||||||
|
|
||||||
return PushRulesViewState(rules)
|
return PushRulesViewState(rules)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user