We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dc0ff26 commit fed3923Copy full SHA for fed3923
crates/matrix-sdk-common/src/deserialized_responses.rs
@@ -97,6 +97,13 @@ pub struct SyncRoomEvent {
97
pub encryption_info: Option<EncryptionInfo>,
98
}
99
100
+impl SyncRoomEvent {
101
+ /// Get the event id of this `SyncRoomEvent` if the event has any valid id.
102
+ pub fn event_id(&self) -> Option<Box<EventId>> {
103
+ self.event.get_field::<Box<EventId>>("event_id").ok().flatten()
104
+ }
105
+}
106
+
107
impl From<Raw<AnySyncRoomEvent>> for SyncRoomEvent {
108
fn from(inner: Raw<AnySyncRoomEvent>) -> Self {
109
Self { encryption_info: None, event: inner }
0 commit comments