fix: Don't unnecessarily embed prev_content in populate_unsigned

This commit is contained in:
timedout committed 2026-09-27 17:32:47 +01:00
1 parent 1de16fed9e
commit fbedf994db
2 files changed
+5 -7

No files matched your search

+5
View File
@@ -53,6 +53,11 @@ impl Pdu {
if let Some(prev_content) = prev_content {
unsigned.insert("prev_content".to_owned(), to_raw_value(&prev_content)?);
// TODO(nex): prev_sender is still inserted in append.rs because
// only the prev *content* is passed to this function.
// I think ideally passing the actual direct `UnsignedContext` to
// this function instead of unpacking its parameters would be the
// proper solution, especially since every callsite has one
}
if let Some(redacted_because) = redacted_because {
unsigned.remove("org.continuwuity.redacted_by");
-7
View File
@@ -336,13 +336,6 @@ impl super::Service {
else {
return;
};
unsigned.insert(
"prev_content".to_owned(),
CanonicalJsonValue::Object(
utils::to_canonical_object(prev_state.get_content_as_value())
.expect("Failed to convert prev_content into canonical JSON object"),
),
);
unsigned.insert(
String::from("prev_sender"),
CanonicalJsonValue::String(prev_state.sender().to_string()),