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


Commits:
b80315b8 by lovetox at 2022-08-14T17:10:52+02:00
fix: ChatList: Update status for private chats correctly

The status was not updated when the corresponding MUC was left.

- - - - -


1 changed file:

- gajim/gtk/chat_list.py


Changes:

=====================================
gajim/gtk/chat_list.py
=====================================
@@ -570,6 +570,10 @@ def __init__(self, workspace_id: str, account: str, jid: 
JID, type_: str,
             self.contact.connect('user-status-show-changed',
                                  self._on_muc_user_update)
 
+            self.contact.room.connect('room-left', self._on_muc_update)
+            self.contact.room.connect('room-destroyed', self._on_muc_update)
+            self.contact.room.connect('room-kicked', self._on_muc_update)
+
         self.contact_name: str = self.contact.name
         self.timestamp: float = 0
         self.stanza_id: Optional[str] = None
@@ -777,6 +781,13 @@ def _on_muc_user_update(self,
                             ) -> None:
         self.update_avatar()
 
+    def _on_muc_update(self,
+                       _contact: GroupchatContact,
+                       _signal_name: str,
+                       *args: Any
+                       ) -> None:
+        self.update_avatar()
+
     def update_avatar(self) -> None:
         scale = self.get_scale_factor()
         surface = self.contact.get_avatar(AvatarSize.ROSTER, scale)
@@ -908,6 +919,9 @@ def _on_state_flags_changed(self,
 
     def _on_destroy(self, _row: ChatRow) -> None:
         self.contact.disconnect_all_from_obj(self)
+        if isinstance(self.contact, GroupchatParticipant):
+            self.contact.room.disconnect_all_from_obj(self)
+
         app.check_finalize(self)
 
     def _on_close_button_clicked(self, _button: Gtk.Button) -> None:



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/b80315b8c7b8417043f1e69757610f316e4c1170

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/b80315b8c7b8417043f1e69757610f316e4c1170
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