Enum ruma_common::push::PushCondition
source · pub enum PushCondition {
EventMatch {
key: String,
pattern: String,
},
ContainsDisplayName,
RoomMemberCount {
is: RoomMemberCountIs,
},
SenderNotificationPermission {
key: String,
},
RoomVersionSupports {
feature: RoomVersionFeature,
},
// some variants omitted
}Expand description
A condition that must apply for an associated push rule’s action to be taken.
Variants§
EventMatch
Fields
A glob pattern match on a field of the event.
ContainsDisplayName
Matches unencrypted messages where content.body contains the owner’s display name in that
room.
RoomMemberCount
Fields
§
is: RoomMemberCountIsThe condition on the current number of members in the room.
Matches the current number of members in the room.
SenderNotificationPermission
Fields
Takes into account the current power levels in the room, ensuring the sender of the event has high enough power to trigger the notification.
RoomVersionSupports
Fields
§
feature: RoomVersionFeatureThe feature the room must support for the push rule to apply.
Available on crate feature
unstable-msc3931 only.Apply the rule only to rooms that support a given feature.
Implementations§
source§impl PushCondition
impl PushCondition
sourcepub fn applies(
&self,
event: &FlattenedJson,
context: &PushConditionRoomCtx
) -> bool
pub fn applies(
&self,
event: &FlattenedJson,
context: &PushConditionRoomCtx
) -> bool
Check if this condition applies to the event.
Arguments
event- The flattened JSON representation of a room message event.context- The context of the room at the time of the event.
Trait Implementations§
source§impl Clone for PushCondition
impl Clone for PushCondition
source§fn clone(&self) -> PushCondition
fn clone(&self) -> PushCondition
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for PushCondition
impl Debug for PushCondition
source§impl<'de> Deserialize<'de> for PushCondition
impl<'de> Deserialize<'de> for PushCondition
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more