diff --git a/crates/ruma-common/src/push/action.rs b/crates/ruma-common/src/push/action.rs index 309ad36e..2bde4dd8 100644 --- a/crates/ruma-common/src/push/action.rs +++ b/crates/ruma-common/src/push/action.rs @@ -30,6 +30,13 @@ pub enum Action { _Custom(CustomAction), } +impl Action { + /// Whether this action is an `Action::SetTweak(Tweak::Highlight(true))`. + pub fn is_highlight(&self) -> bool { + matches!(self, Action::SetTweak(Tweak::Highlight(true))) + } +} + /// The `set_tweak` action. #[derive(Clone, Debug, Deserialize, Serialize)] #[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]