PushRule

@JsonClass(generateAdapter = true)
data class PushRule(@Json(name = "actions") val actions: List<Any>, @Json(name = "default") val default: Boolean? = false, @Json(name = "enabled") val enabled: Boolean, @Json(name = "rule_id") val ruleId: String, @Json(name = "conditions") val conditions: List<PushCondition>? = null, @Json(name = "pattern") val pattern: String? = null)

Ref: https://matrix.org/docs/spec/client_server/latest#get-matrix-client-r0-pushrules

Constructors

Link copied to clipboard
constructor(@Json(name = "actions") actions: List<Any>, @Json(name = "default") default: Boolean? = false, @Json(name = "enabled") enabled: Boolean, @Json(name = "rule_id") ruleId: String, @Json(name = "conditions") conditions: List<PushCondition>? = null, @Json(name = "pattern") pattern: String? = null)

Functions

Link copied to clipboard
Link copied to clipboard

Get the highlight status. As spec mentions assume false if no tweak present.

Link copied to clipboard
Link copied to clipboard

Remove the notification sound.

Link copied to clipboard
fun setHighlight(highlight: Boolean): PushRule

Set the highlight status.

Link copied to clipboard

Add the default notification sound.

Set the notification sound.

Link copied to clipboard
fun setNotify(notify: Boolean): PushRule

Set the notification status.

Link copied to clipboard

Return true if the rule should highlight the event.

Link copied to clipboard

Return true if the rule should not highlight the event.

Properties

Link copied to clipboard

Required. The actions to perform when this rule is matched.

Link copied to clipboard

The conditions that must hold true for an event in order for a rule to be applied to an event.

Link copied to clipboard
val default: Boolean? = false

Required. Whether this is a default rule, or has been set explicitly.

Link copied to clipboard

Required. Whether the push rule is enabled or not.

Link copied to clipboard
val pattern: String? = null

The glob-style pattern to match against. Only applicable to content rules.

Link copied to clipboard

Required. The ID of this rule.