Philipp Hörist pushed to branch mainwindow at gajim / gajim


Commits:
a32bd7c8 by lovetox at 2021-07-22T17:45:45+02:00
Fix destroying MUCs

- - - - -
dc32941b by lovetox at 2021-07-22T19:57:38+02:00
Fix closing the control

- - - - -


2 changed files:

- gajim/common/modules/muc.py
- gajim/gtk/controls/groupchat.py


Changes:

=====================================
gajim/common/modules/muc.py
=====================================
@@ -485,6 +485,7 @@ def _on_muc_user_presence(self, _con, stanza, properties):
             self._log.info('MUC destroyed: %s', room_jid)
             self._remove_join_timeout(room_jid)
             self._set_muc_state(room_jid, MUCJoinedState.NOT_JOINED)
+            self._con.get_module('Bookmarks').remove(room_jid)
             room.set_not_joined()
             room.notify('room-destroyed', properties)
             return


=====================================
gajim/gtk/controls/groupchat.py
=====================================
@@ -128,9 +128,6 @@ def __init__(self, account, jid):
         # if True, the room has mentioned us
         self.attention_flag = False
 
-        # True if we initiated room destruction
-        self._wait_for_destruction = False
-
         # sorted list of nicks who mentioned us (last at the end)
         self.attention_list = []
         self.nick_hits = []
@@ -490,7 +487,6 @@ def _on_destroy_alternate_changed(self, entry, _param):
     def _on_destroy_confirm(self, _button):
         reason = self.xml.destroy_reason_entry.get_text()
         jid = self.xml.destroy_alternate_entry.get_text()
-        self._wait_for_destruction = True
         self._client.get_module('MUC').destroy(self.room_jid, reason, jid)
         self._show_page('groupchat')
 
@@ -1173,11 +1169,6 @@ def _on_room_destroyed(self, _contact, _signal_name, 
properties):
                              'instead: xmpp:%s?join') % str(alternate)
             self.add_info_message(join_message)
 
-        self._client.get_module('Bookmarks').remove(self.room_jid)
-
-        if self._wait_for_destruction:
-            self._close_control()
-
     def _on_message_sent(self, event):
         if not event.message:
             return
@@ -1296,8 +1287,10 @@ def on_cancel(is_checked):
 
         on_yes(self)
 
-    def _close_control(self, reason=None):
-        self.shutdown(reason)
+    def _close_control(self):
+        app.window.activate_action(
+            'remove-chat',
+            GLib.Variant('as', [self.account, str(self.room_jid)]))
 
     def set_control_active(self, state):
         self.attention_flag = False
@@ -1673,9 +1666,7 @@ def _on_page_close_clicked(self, _button=None):
         self._close_control()
 
     def _on_groupchat_state_abort_clicked(self, _button):
-        app.window.activate_action(
-            'remove-chat',
-            GLib.Variant('as', [self.account, str(self.room_jid)]))
+        self._close_control()
 
     def _on_groupchat_state_join_clicked(self, _groupchat_state):
         self._client.get_module('MUC').join(self.room_jid)



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/01779713ea762ae71374c1e6fbd6cbc6630458c1...dc32941b96a341340ff8975d2abcf62be9bc407c

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/01779713ea762ae71374c1e6fbd6cbc6630458c1...dc32941b96a341340ff8975d2abcf62be9bc407c
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list
Commits@gajim.org
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to