mirror of
https://github.com/element-hq/synapse.git
synced 2026-05-31 19:44:29 +00:00
Add MSC4354_STICKY constant
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user