File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
crates/matrix-sdk/src/room Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -250,16 +250,14 @@ impl Room {
250
250
/// Only invited and left rooms can be joined via this method.
251
251
#[ doc( alias = "accept_invitation" ) ]
252
252
pub async fn join ( & self ) -> Result < ( ) > {
253
- let state = self . state ( ) ;
254
- if state == RoomState :: Joined {
253
+ let prev_room_state = self . inner . state ( ) ;
254
+ if prev_room_state == RoomState :: Joined {
255
255
return Err ( Error :: WrongRoomState ( Box :: new ( WrongRoomState :: new (
256
256
"Invited or Left" ,
257
- state ,
257
+ prev_room_state ,
258
258
) ) ) ) ;
259
259
}
260
260
261
- let prev_room_state = self . inner . state ( ) ;
262
-
263
261
let mark_as_direct = prev_room_state == RoomState :: Invited
264
262
&& self . inner . is_direct ( ) . await . unwrap_or_else ( |e| {
265
263
warn ! ( room_id = ?self . room_id( ) , "is_direct() failed: {e}" ) ;
You can’t perform that action at this time.
0 commit comments