Philipp Hörist pushed to branch master at gajim / gajim
Commits:
c5a44be1 by Philipp Hörist at 2022-10-06T21:24:10+02:00
cfix: BaseModule: Disconnect all client event handlers on cleanup()
- - - - -
ff4df9d9 by Philipp Hörist at 2022-10-06T21:24:49+02:00
refactor: MUC: Remove all timeouts on cleanup()
- - - - -
2 changed files:
- gajim/common/modules/base.py
- gajim/common/modules/muc.py
Changes:
=====================================
gajim/common/modules/base.py
=====================================
@@ -114,3 +114,4 @@ def _get_contact(self,
def cleanup(self) -> None:
self.unregister_events()
+ self._client.disconnect_all_from_obj(self)
=====================================
gajim/common/modules/muc.py
=====================================
@@ -216,12 +216,7 @@ def _set_muc_state(self, room_jid: str, state:
MUCJoinedState) -> None:
contact.notify('state-changed')
def _reset_state(self) -> None:
- for room_jid in list(self._rejoin_timeouts.keys()):
- self._remove_rejoin_timeout(room_jid)
-
- for room_jid in list(self._join_timeouts.keys()):
- self._remove_join_timeout(room_jid)
-
+ self._remove_all_timeouts()
for muc in self._mucs.values():
self._joined_users.pop(muc.jid, None)
self._set_muc_state(muc.jid, MUCJoinedState.NOT_JOINED)
@@ -1128,3 +1123,14 @@ def _on_client_resume_failed(self,
_signal_name: str
) -> None:
self._reset_state()
+
+ def _remove_all_timeouts(self) -> None:
+ for room_jid in list(self._rejoin_timeouts.keys()):
+ self._remove_rejoin_timeout(room_jid)
+
+ for room_jid in list(self._join_timeouts.keys()):
+ self._remove_join_timeout(room_jid)
+
+ def cleanup(self) -> None:
+ super().cleanup()
+ self._remove_all_timeouts()
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/37dca1cb6eb5d5dd9f693c7cd93ac3f278d33103...ff4df9d9af83a7a53f5cc81e09a10caea3979c6d
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/37dca1cb6eb5d5dd9f693c7cd93ac3f278d33103...ff4df9d9af83a7a53f5cc81e09a10caea3979c6d
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits