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 {
250250 /// Only invited and left rooms can be joined via this method.
251251 #[ doc( alias = "accept_invitation" ) ]
252252 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 {
255255 return Err ( Error :: WrongRoomState ( Box :: new ( WrongRoomState :: new (
256256 "Invited or Left" ,
257- state ,
257+ prev_room_state ,
258258 ) ) ) ) ;
259259 }
260260
261- let prev_room_state = self . inner . state ( ) ;
262-
263261 let mark_as_direct = prev_room_state == RoomState :: Invited
264262 && self . inner . is_direct ( ) . await . unwrap_or_else ( |e| {
265263 warn ! ( room_id = ?self . room_id( ) , "is_direct() failed: {e}" ) ;
You can’t perform that action at this time.
0 commit comments