Add MSC4354_STICKY constant

This commit is contained in:
Erik Johnston
2026-05-27 11:51:03 +01:00
parent 17b231c3e8
commit ffe6c8b430
2 changed files with 5 additions and 3 deletions
+2
View File
@@ -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 {
+3 -3
View File
@@ -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