mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-14 19:16:02 -04:00
refactor(base): Add RoomInfo::new constructor
This commit is contained in:
committed by
Jonas Platte
parent
4187aa400f
commit
a43005dec2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user