refactor(base): Add RoomInfo::new constructor
@@ -103,16 +103,7 @@ impl Room {
room_id: &RoomId,
room_type: RoomType,
) -> Self {
- let room_info = RoomInfo {
- room_id: room_id.into(),
- room_type,
- notification_counts: Default::default(),
- summary: Default::default(),
- members_synced: false,
- last_prev_batch: None,
- base_info: BaseRoomInfo::new(),
- };
-
+ let room_info = RoomInfo::new(room_id, room_type);
Self::restore(own_user_id, store, room_info)
}
@@ -655,6 +646,18 @@ pub struct RoomInfo {
}
impl RoomInfo {
+ pub(crate) fn new(room_id: &RoomId, room_type: RoomType) -> Self {
+ Self {
+ room_id: room_id.into(),
+ room_type,
+ notification_counts: Default::default(),
+ summary: Default::default(),
+ members_synced: false,
+ last_prev_batch: None,
+ base_info: BaseRoomInfo::new(),
+ }
+ }
+
/// Mark this Room as joined
pub fn mark_as_joined(&mut self) {
self.room_type = RoomType::Joined;
