Enum ruma::push::PushCondition
source · [−]pub enum PushCondition {
EventMatch {
key: String,
pattern: String,
},
ContainsDisplayName,
RoomMemberCount {
is: RoomMemberCountIs,
},
SenderNotificationPermission {
key: String,
},
}
Expand description
A condition that must apply for an associated push rule’s action to be taken.
Variants
EventMatch
Fields
key: String
The dot-separated field of the event to match.
pattern: String
The glob-style pattern to match against.
Patterns with no special glob characters should be treated as having asterisks prepended and appended when testing the condition.
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: RoomMemberCountIs
The condition on the current number of members in the room.
Matches the current number of members in the room.
SenderNotificationPermission
Fields
key: String
The field in the power level event the user needs a minimum power level for.
Fields must be specified under the notifications
property in the power level event’s
content
.
Takes into account the current power levels in the room, ensuring the sender of the event has high enough power to trigger the notification.
Implementations
sourceimpl 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
sourceimpl Clone for PushCondition
impl Clone for PushCondition
sourcefn clone(&self) -> PushCondition
fn clone(&self) -> PushCondition
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more