Skip to content
Snippets Groups Projects
Unverified Commit 1bf614b0 authored by Timo Kösters's avatar Timo Kösters
Browse files

fix: remove transaction_id from pdus over federation

parent b7ab5789
No related branches found
No related tags found
No related merge requests found
......@@ -36,6 +36,12 @@ pub fn start_handler(&self, globals: &super::globals::Globals, rooms: &super::ro
let pdu_id = parts.next().ok_or_else(|| Error::bad_database("Invalid serverpduid in db."))?;
let mut pdu_json = rooms.get_pdu_json_from_id(&pdu_id.into())?.ok_or_else(|| Error::bad_database("Event in serverpduids not found in db."))?;
if let Some(unsigned) = pdu_json
.as_object_mut()
.expect("json is object")
.get_mut("unsigned") {
unsigned.as_object_mut().expect("unsigned is object").remove("transaction_id");
}
pdu_json
.as_object_mut()
.expect("json is object")
......
......@@ -201,6 +201,9 @@ pub fn to_member_event(&self) -> Raw<StateEvent<MemberEventContent>> {
}
pub fn to_outgoing_federation_event(&self) -> Raw<PduStub> {
let mut unsigned = self.unsigned.clone();
unsigned.remove("transaction_id");
let mut json = json!({
"room_id": self.room_id,
"sender": self.sender,
......@@ -210,7 +213,7 @@ pub fn to_outgoing_federation_event(&self) -> Raw<PduStub> {
"prev_events": self.prev_events,
"depth": self.depth,
"auth_events": self.auth_events,
"unsigned": self.unsigned,
"unsigned": unsigned,
"hashes": self.hashes,
"signatures": self.signatures,
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment