Fix unstable-pre-spec for federation membership join
This commit is contained in:
parent
11e8856a91
commit
26b0f738a5
@ -23,9 +23,10 @@ thiserror = "1.0.20"
|
||||
tracing-subscriber = "0.2.11"
|
||||
|
||||
[dependencies.ruma]
|
||||
git = "https://github.com/ruma/ruma"
|
||||
rev = "8049631827ab8557cb1010d195dd6468f90effa8"
|
||||
features = ["client-api", "federation-api", "appservice-api"]
|
||||
# git = "https://github.com/ruma/ruma"
|
||||
path = "../__forks__/ruma/ruma"
|
||||
# rev = "64b9c646d15a359d62ab464a95176ff94adb2554"
|
||||
features = ["client-api", "federation-api", "appservice-api", "unstable-pre-spec", "unstable-synapse-quirks"]
|
||||
|
||||
#[dependencies.ruma]
|
||||
#path = "../ruma/ruma"
|
||||
|
@ -125,7 +125,12 @@ impl StateEvent {
|
||||
Self::Full(ev) => match ev {
|
||||
Pdu::RoomV1Pdu(ev) => ev.event_id.clone(),
|
||||
Pdu::RoomV3Pdu(ev) => {
|
||||
let value = serde_json::to_value(ev).expect("all ruma pdus are json values");
|
||||
let mut value = serde_json::from_slice::<BTreeMap<_, _>>(
|
||||
&serde_json::to_vec(ev).expect("all ruma pdus are json values"),
|
||||
)
|
||||
.unwrap();
|
||||
value.remove("event_id");
|
||||
|
||||
EventId::try_from(&*format!(
|
||||
"${}",
|
||||
ruma::signatures::reference_hash(&value, &self.room_version())
|
||||
@ -195,7 +200,8 @@ impl StateEvent {
|
||||
PduStub::RoomV1PduStub(ev) => ev.state_key.clone(),
|
||||
PduStub::RoomV3PduStub(ev) => ev.state_key.clone(),
|
||||
},
|
||||
}.expect("All state events have a state key")
|
||||
}
|
||||
.expect("All state events have a state key")
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "unstable-pre-spec"))]
|
||||
|
@ -31,7 +31,7 @@ pub trait StateStore {
|
||||
|
||||
result.push(ev_id.clone());
|
||||
|
||||
let event = self.get_event(room_id, &ev_id).unwrap();
|
||||
let event = self.get_event(room_id, &ev_id)?;
|
||||
|
||||
stack.extend(event.auth_events());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user