Skip to content

Commit 49a0765

Browse files
zecakehpoljar
authored andcommitted
refactor(base): Remove the event_id field of PredecessorRoom
It is going away in MSC4291, which should be accepted next week. Removing it now makes sure that no one uses it. Signed-off-by: Kévin Commaille <[email protected]>
1 parent 39cf8b3 commit 49a0765

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

bindings/matrix-sdk-ffi/src/room/mod.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1504,13 +1504,10 @@ impl From<SdkSuccessorRoom> for SuccessorRoom {
15041504
pub struct PredecessorRoom {
15051505
/// The ID of the replacement room.
15061506
pub room_id: String,
1507-
1508-
/// The event ID of the last known event in the predecesssor room.
1509-
pub last_event_id: String,
15101507
}
15111508

15121509
impl From<SdkPredecessorRoom> for PredecessorRoom {
15131510
fn from(value: SdkPredecessorRoom) -> Self {
1514-
Self { room_id: value.room_id.to_string(), last_event_id: value.last_event_id.to_string() }
1511+
Self { room_id: value.room_id.to_string() }
15151512
}
15161513
}

crates/matrix-sdk-base/src/room/tombstone.rs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
use std::ops::Not;
1616

17-
use ruma::{events::room::tombstone::RoomTombstoneEventContent, OwnedEventId, OwnedRoomId};
17+
use ruma::{events::room::tombstone::RoomTombstoneEventContent, OwnedRoomId};
1818

1919
use super::Room;
2020

@@ -67,12 +67,9 @@ impl Room {
6767
/// [`m.room.tombstone`]: https://spec.matrix.org/v1.14/client-server-api/#mroomtombstone
6868
/// [`m.room.create`]: https://spec.matrix.org/v1.14/client-server-api/#mroomcreate
6969
pub fn predecessor_room(&self) -> Option<PredecessorRoom> {
70-
self.create_content().and_then(|content_event| content_event.predecessor).map(
71-
|predecessor| PredecessorRoom {
72-
room_id: predecessor.room_id,
73-
last_event_id: predecessor.event_id,
74-
},
75-
)
70+
self.create_content()
71+
.and_then(|content_event| content_event.predecessor)
72+
.map(|predecessor| PredecessorRoom { room_id: predecessor.room_id })
7673
}
7774
}
7875

@@ -104,9 +101,6 @@ pub struct SuccessorRoom {
104101
pub struct PredecessorRoom {
105102
/// The ID of the old room.
106103
pub room_id: OwnedRoomId,
107-
108-
/// The event ID of the last known event in the predecesssor room.
109-
pub last_event_id: OwnedEventId,
110104
}
111105

112106
#[cfg(test)]
@@ -252,7 +246,6 @@ mod tests {
252246
assert!(room.create_content().is_some());
253247
assert_matches!(room.predecessor_room(), Some(predecessor_room) => {
254248
assert_eq!(predecessor_room.room_id, predecessor_room_id);
255-
assert_eq!(predecessor_room.last_event_id, predecessor_last_event_id);
256249
});
257250
}
258251
}

0 commit comments

Comments
 (0)