| ... |
... |
@@ -143,7 +143,6 @@ def __init__(self, con: types.Client) -> None: |
|
143
|
143
|
self._on_client_resume_failed)
|
|
144
|
144
|
|
|
145
|
145
|
self._rejoin_muc: set[str] = set()
|
|
146
|
|
- self._join_timeouts: dict[str, int] = {}
|
|
147
|
146
|
self._rejoin_timeouts: dict[str, int] = {}
|
|
148
|
147
|
self._muc_service_jid = None
|
|
149
|
148
|
self._joined_users: defaultdict[
|
| ... |
... |
@@ -362,7 +361,6 @@ def leave(self, |
|
362
|
361
|
if muc_data.state.is_not_joined:
|
|
363
|
362
|
return
|
|
364
|
363
|
|
|
365
|
|
- self._remove_join_timeout(room_jid)
|
|
366
|
364
|
self._remove_rejoin_timeout(room_jid)
|
|
367
|
365
|
|
|
368
|
366
|
self._con.get_module('Presence').send_presence(
|
| ... |
... |
@@ -563,7 +561,6 @@ def _on_muc_user_presence(self, |
|
563
|
561
|
|
|
564
|
562
|
if properties.is_muc_destroyed:
|
|
565
|
563
|
self._log.info('MUC destroyed: %s', room_jid)
|
|
566
|
|
- self._remove_join_timeout(room_jid)
|
|
567
|
564
|
self._set_muc_state(room_jid, MUCJoinedState.NOT_JOINED)
|
|
568
|
565
|
self._con.get_module('Bookmarks').remove(room_jid)
|
|
569
|
566
|
room.set_not_joined()
|
| ... |
... |
@@ -630,8 +627,6 @@ def _on_muc_user_presence(self, |
|
630
|
627
|
if properties.is_new_room:
|
|
631
|
628
|
self.configure_room(room_jid)
|
|
632
|
629
|
|
|
633
|
|
- self._start_join_timeout(room_jid)
|
|
634
|
|
-
|
|
635
|
630
|
presence = self._process_user_presence(properties)
|
|
636
|
631
|
self._process_occupant_presence_change(properties,
|
|
637
|
632
|
presence,
|
| ... |
... |
@@ -793,20 +788,6 @@ def _remove_rejoin_timeout(self, room_jid: str) -> None: |
|
793
|
788
|
GLib.source_remove(id_)
|
|
794
|
789
|
del self._rejoin_timeouts[room_jid]
|
|
795
|
790
|
|
|
796
|
|
- def _start_join_timeout(self, room_jid: str) -> None:
|
|
797
|
|
- self._remove_join_timeout(room_jid)
|
|
798
|
|
- self._log.info('Start join timeout for: %s', room_jid)
|
|
799
|
|
- id_ = GLib.timeout_add_seconds(
|
|
800
|
|
- 10, self._fake_subject_change, room_jid)
|
|
801
|
|
- self._join_timeouts[room_jid] = id_
|
|
802
|
|
-
|
|
803
|
|
- def _remove_join_timeout(self, room_jid: str) -> None:
|
|
804
|
|
- id_ = self._join_timeouts.get(room_jid)
|
|
805
|
|
- if id_ is not None:
|
|
806
|
|
- self._log.info('Remove join timeout for: %s', room_jid)
|
|
807
|
|
- GLib.source_remove(id_)
|
|
808
|
|
- del self._join_timeouts[room_jid]
|
|
809
|
|
-
|
|
810
|
791
|
def _on_subject_change(self,
|
|
811
|
792
|
_con: types.xmppClient,
|
|
812
|
793
|
_stanza: Message,
|
| ... |
... |
@@ -868,19 +849,10 @@ def _on_moderation(self, |
|
868
|
849
|
|
|
869
|
850
|
raise nbxmpp.NodeProcessed
|
|
870
|
851
|
|
|
871
|
|
- def _fake_subject_change(self, room_jid: str) -> None:
|
|
872
|
|
- # This is for servers which don’t send empty subjects as part of the
|
|
873
|
|
- # event order on joining a MUC. For example jabber.ru
|
|
874
|
|
- self._log.warning('Fake subject received for %s', room_jid)
|
|
875
|
|
- del self._join_timeouts[room_jid]
|
|
876
|
|
- room = self._get_contact(room_jid)
|
|
877
|
|
- room.notify('room-joined')
|
|
878
|
|
-
|
|
879
|
852
|
def cancel_password_request(self, room_jid: str) -> None:
|
|
880
|
853
|
self._set_muc_state(room_jid, MUCJoinedState.NOT_JOINED)
|
|
881
|
854
|
|
|
882
|
855
|
def _room_join_complete(self, muc_data: MUCData):
|
|
883
|
|
- self._remove_join_timeout(muc_data.jid)
|
|
884
|
856
|
self._set_muc_state(muc_data.jid, MUCJoinedState.JOINED)
|
|
885
|
857
|
self._remove_rejoin_timeout(muc_data.jid)
|
|
886
|
858
|
|
| ... |
... |
@@ -1128,9 +1100,6 @@ def _remove_all_timeouts(self) -> None: |
|
1128
|
1100
|
for room_jid in list(self._rejoin_timeouts.keys()):
|
|
1129
|
1101
|
self._remove_rejoin_timeout(room_jid)
|
|
1130
|
1102
|
|
|
1131
|
|
- for room_jid in list(self._join_timeouts.keys()):
|
|
1132
|
|
- self._remove_join_timeout(room_jid)
|
|
1133
|
|
-
|
|
1134
|
1103
|
def cleanup(self) -> None:
|
|
1135
|
1104
|
super().cleanup()
|
|
1136
|
1105
|
self._remove_all_timeouts() |