Ver Fonte

Drop the redundant JoinRoom in _refresh_rooms

new_room_ids only contains rooms the directory scan already reported as
member of (viewer_state.is_member), so the call re-joined held
memberships — one wasted RPC per discovered room. _run_join documents
the opposite rule: natively invited rooms need no JoinRoom call, which
proves membership alone suffices for event delivery. The old trailing
comment was thinking out loud; it now states the why.
Paul Klumpp há 1 semana atrás
pai
commit
cee69428d9
1 ficheiros alterados com 3 adições e 4 exclusões
  1. 3 4
      adapter.py

+ 3 - 4
adapter.py

@@ -1553,10 +1553,9 @@ class ChattoAdapter(BasePlatformAdapter):
             )
 
             for rid in new_room_ids:
-                if self._room_kinds.get(rid) != RoomKind.DM:
-                    await client.join_room(
-                        rid
-                    )  # but list_rooms() would not return any if we were not already joined?!
+                # Membership came straight from the directory scan
+                # (viewer_state.is_member); natively invited rooms need no
+                # JoinRoom call — same rule as _run_join.
                 if self._is_respond_room(rid):
                     await self._seed_room(rid)
                 else: