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'"
|
override fun technicalDescription() = "'$key' matches '$pattern'"
|
||||||
|
|
||||||
fun isSatisfied(event: Event): Boolean {
|
fun isSatisfied(event: Event): Boolean {
|
||||||
// TODO encrypted events?
|
val rawJson: Map<*, *> = event.mxDecryptionResult?.payload ?: MoshiProvider.providesMoshi().adapter(Event::class.java).toJsonValue(event) as? Map<*, *>
|
||||||
val rawJson = MoshiProvider.providesMoshi().adapter(Event::class.java).toJsonValue(event) as? Map<*, *>
|
?: return false
|
||||||
?: return false
|
|
||||||
val value = extractField(rawJson, key) ?: return false
|
val value = extractField(rawJson, key) ?: return false
|
||||||
|
|
||||||
// The match is performed case-insensitively, and must match the entire value of
|
// The match is performed case-insensitively, and must match the entire value of
|
||||||
|
Loading…
x
Reference in New Issue
Block a user