add replaces_state
and prev_sender
in unsigned
for membership changes
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
ea03a50e21
commit
01a77f8a71
1 changed files with 13 additions and 1 deletions
|
@ -236,11 +236,19 @@ impl Service {
|
||||||
"prev_content".to_owned(),
|
"prev_content".to_owned(),
|
||||||
CanonicalJsonValue::Object(
|
CanonicalJsonValue::Object(
|
||||||
utils::to_canonical_object(prev_state.content.clone()).map_err(|e| {
|
utils::to_canonical_object(prev_state.content.clone()).map_err(|e| {
|
||||||
error!("Failed to convert prev_state to canonical JSON: {}", e);
|
error!("Failed to convert prev_state to canonical JSON: {e}");
|
||||||
Error::bad_database("Failed to convert prev_state to canonical JSON.")
|
Error::bad_database("Failed to convert prev_state to canonical JSON.")
|
||||||
})?,
|
})?,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
unsigned.insert(
|
||||||
|
String::from("prev_sender"),
|
||||||
|
CanonicalJsonValue::String(prev_state.sender.clone().to_string()),
|
||||||
|
);
|
||||||
|
unsigned.insert(
|
||||||
|
String::from("replaces_state"),
|
||||||
|
CanonicalJsonValue::String(prev_state.event_id.clone().to_string()),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -660,6 +668,10 @@ impl Service {
|
||||||
"prev_sender".to_owned(),
|
"prev_sender".to_owned(),
|
||||||
serde_json::to_value(&prev_pdu.sender).expect("UserId::to_value always works"),
|
serde_json::to_value(&prev_pdu.sender).expect("UserId::to_value always works"),
|
||||||
);
|
);
|
||||||
|
unsigned.insert(
|
||||||
|
"replaces_state".to_owned(),
|
||||||
|
serde_json::to_value(&prev_pdu.event_id).expect("EventId is valid json"),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue