Apply push rules on encrypted events
This commit is contained in:
parent
ef38ba033f
commit
b6ac915805
|
@ -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 New Issue