From ffe6c8b43046e7c1bf59837aec1978be6e64c8e1 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Wed, 27 May 2026 11:51:03 +0100 Subject: [PATCH] Add MSC4354_STICKY constant --- rust/src/events/constants.rs | 2 ++ rust/src/events/mod.rs | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/rust/src/events/constants.rs b/rust/src/events/constants.rs index e68a62c32f..26209e4ba0 100644 --- a/rust/src/events/constants.rs +++ b/rust/src/events/constants.rs @@ -59,6 +59,8 @@ pub mod event_field { pub const MEMBERSHIP: &str = "membership"; /// Event field: replaces_state pub const REPLACES_STATE: &str = "replaces_state"; + /// Event field: msc4354_sticky + pub const MSC4354_STICKY: &str = "msc4354_sticky"; } pub mod unsigned_field { diff --git a/rust/src/events/mod.rs b/rust/src/events/mod.rs index 409e268ef3..0614ac7ffb 100644 --- a/rust/src/events/mod.rs +++ b/rust/src/events/mod.rs @@ -69,7 +69,7 @@ use crate::events::{ use crate::{ duration::SynapseDuration, events::{ - constants::event_field::{HASHES, SIGNATURES, UNSIGNED}, + constants::event_field::{HASHES, MSC4354_STICKY, SIGNATURES, UNSIGNED}, constants::membership_field::MEMBERSHIP, constants::redaction_field::REDACTS, constants::unsigned_field::{AGE, AGE_TS, REDACTED_BECAUSE}, @@ -346,7 +346,7 @@ impl Event { .parsed_event .common_fields .other_fields - .get("msc4354_sticky"); + .get(MSC4354_STICKY); let sticky_obj = match sticky_obj { Some(serde_json::Value::Object(obj)) => obj, @@ -797,7 +797,7 @@ mod tests { assert!(event .common_fields .other_fields - .contains_key("msc4354_sticky")); + .contains_key(MSC4354_STICKY)); assert!(event .common_fields .other_fields