mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-24 18:36:21 +03:00
Apply push rules on encrypted events
This commit is contained in:
parent
ef38ba033f
commit
b6ac915805
1 changed files with 2 additions and 3 deletions
|
@ -39,9 +39,8 @@ class EventMatchCondition(
|
|||
override fun technicalDescription() = "'$key' matches '$pattern'"
|
||||
|
||||
fun isSatisfied(event: Event): Boolean {
|
||||
// TODO encrypted events?
|
||||
val rawJson = MoshiProvider.providesMoshi().adapter(Event::class.java).toJsonValue(event) as? Map<*, *>
|
||||
?: return false
|
||||
val rawJson: Map<*, *> = event.mxDecryptionResult?.payload ?: MoshiProvider.providesMoshi().adapter(Event::class.java).toJsonValue(event) as? Map<*, *>
|
||||
?: return false
|
||||
val value = extractField(rawJson, key) ?: return false
|
||||
|
||||
// The match is performed case-insensitively, and must match the entire value of
|
||||
|
|
Loading…
Reference in a new issue