Rebase with key backups and cross signing
Moved back to a fork of ruma with timo's key-backup and cross-signing branch. Ephemeral events in sync responses are EphemeralRoomEventStub (they also have no room_id like all of sync responses events)
This commit is contained in:
parent
84dcb885a7
commit
63e23154f3
6 changed files with 2149 additions and 25 deletions
|
@ -2,8 +2,9 @@ use crate::{Error, Result};
|
|||
use js_int::UInt;
|
||||
use ruma::{
|
||||
events::{
|
||||
pdu::EventHash, AnyRoomEvent, AnyRoomEventStub, AnyStateEvent, AnyStateEventStub,
|
||||
AnyStrippedStateEventStub, EventJson, EventType,
|
||||
pdu::EventHash, room::member::MemberEventContent, AnyRoomEvent, AnyRoomEventStub,
|
||||
AnyStateEvent, AnyStateEventStub, AnyStrippedStateEventStub, EventJson, EventType,
|
||||
StateEvent,
|
||||
},
|
||||
identifiers::{EventId, RoomId, UserId},
|
||||
};
|
||||
|
@ -103,9 +104,9 @@ impl PduEvent {
|
|||
serde_json::from_str::<EventJson<AnyStrippedStateEventStub>>(&json)
|
||||
.expect("EventJson::from_str always works")
|
||||
}
|
||||
pub fn to_member_event(&self) -> EventJson<MemberEvent> {
|
||||
pub fn to_member_event(&self) -> EventJson<StateEvent<MemberEventContent>> {
|
||||
let json = serde_json::to_string(&self).expect("PDUs are always valid");
|
||||
serde_json::from_str::<EventJson<MemberEvent>>(&json)
|
||||
serde_json::from_str::<EventJson<StateEvent<MemberEventContent>>>(&json)
|
||||
.expect("EventJson::from_str always works")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue