File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,15 @@ impl RoomUpdates {
97
97
. chain ( self . invited . keys ( ) )
98
98
. chain ( self . knocked . keys ( ) )
99
99
}
100
+
101
+ /// Returns whether or not this update contains any changes to the list
102
+ /// of invited, joined, knocked or left rooms.
103
+ pub fn is_empty ( & self ) -> bool {
104
+ self . invited . is_empty ( )
105
+ && self . joined . is_empty ( )
106
+ && self . knocked . is_empty ( )
107
+ && self . left . is_empty ( )
108
+ }
100
109
}
101
110
102
111
#[ cfg( test) ]
Original file line number Diff line number Diff line change @@ -77,7 +77,11 @@ impl SpaceService {
77
77
78
78
loop {
79
79
match all_room_updates_receiver. recv ( ) . await {
80
- Ok ( _) => {
80
+ Ok ( updates) => {
81
+ if updates. is_empty ( ) {
82
+ continue ;
83
+ }
84
+
81
85
let new_spaces = Vector :: from ( Self :: joined_spaces_for ( & client) . await ) ;
82
86
Self :: update_joined_spaces_if_needed ( new_spaces, & joined_spaces) ;
83
87
}
Original file line number Diff line number Diff line change @@ -66,6 +66,10 @@ impl SpaceRoomList {
66
66
loop {
67
67
match all_room_updates_receiver. recv ( ) . await {
68
68
Ok ( updates) => {
69
+ if updates. is_empty ( ) {
70
+ continue ;
71
+ }
72
+
69
73
let mut mutable_rooms = rooms_clone. lock ( ) ;
70
74
71
75
updates. iter_all_room_ids ( ) . for_each ( |updated_room_id| {
You can’t perform that action at this time.
0 commit comments