File tree Expand file tree Collapse file tree 2 files changed +8
-12
lines changed
crates/matrix-sdk-ui/src/room_list_service Expand file tree Collapse file tree 2 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -433,7 +433,10 @@ impl RoomListService {
433
433
return Ok ( room. clone ( ) ) ;
434
434
}
435
435
436
- let room = Room :: new ( & self . client , room_id, & self . sliding_sync ) ?;
436
+ let room = Room :: new (
437
+ self . client . get_room ( room_id) . ok_or_else ( || Error :: RoomNotFound ( room_id. to_owned ( ) ) ) ?,
438
+ & self . sliding_sync ,
439
+ ) ;
437
440
438
441
// Save for later.
439
442
rooms. push ( room. clone ( ) ) ;
Original file line number Diff line number Diff line change 17
17
use std:: { ops:: Deref , sync:: Arc } ;
18
18
19
19
use async_once_cell:: OnceCell as AsyncOnceCell ;
20
- use matrix_sdk:: { Client , SlidingSync } ;
20
+ use matrix_sdk:: SlidingSync ;
21
21
use ruma:: { api:: client:: sync:: sync_events:: v4:: RoomSubscription , events:: StateEventType , RoomId } ;
22
22
23
23
use super :: Error ;
@@ -56,21 +56,14 @@ impl Deref for Room {
56
56
57
57
impl Room {
58
58
/// Create a new `Room`.
59
- pub ( super ) fn new (
60
- client : & Client ,
61
- room_id : & RoomId ,
62
- sliding_sync : & Arc < SlidingSync > ,
63
- ) -> Result < Self , Error > {
64
- let room =
65
- client. get_room ( room_id) . ok_or_else ( || Error :: RoomNotFound ( room_id. to_owned ( ) ) ) ?;
66
-
67
- Ok ( Self {
59
+ pub ( super ) fn new ( room : matrix_sdk:: Room , sliding_sync : & Arc < SlidingSync > ) -> Self {
60
+ Self {
68
61
inner : Arc :: new ( RoomInner {
69
62
sliding_sync : sliding_sync. clone ( ) ,
70
63
room,
71
64
timeline : AsyncOnceCell :: new ( ) ,
72
65
} ) ,
73
- } )
66
+ }
74
67
}
75
68
76
69
/// Get the room ID.
You can’t perform that action at this time.
0 commit comments