Skip to content

Commit a46a11a

Browse files
committed
common: Add method to get the event id from a SyncRoomEvent
1 parent 52f24e9 commit a46a11a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

matrix_sdk_common/src/deserialized_responses.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,13 @@ pub struct SyncRoomEvent {
9696
pub encryption_info: Option<EncryptionInfo>,
9797
}
9898

99+
impl SyncRoomEvent {
100+
/// Get the event id of this `SyncRoomEvent`
101+
pub fn event_id(&self) -> EventId {
102+
self.event.get_field::<EventId>("event_id").unwrap().unwrap()
103+
}
104+
}
105+
99106
impl From<Raw<AnySyncRoomEvent>> for SyncRoomEvent {
100107
fn from(inner: Raw<AnySyncRoomEvent>) -> Self {
101108
Self { encryption_info: None, event: inner }

0 commit comments

Comments
 (0)