Daniel Brötzmann pushed to branch master at gajim / gajim


Commits:
6767244a by wurstsalat at 2023-11-07T21:39:14+01:00
fix: ChatList: Update mute state periodically

Fixes #11456

- - - - -


2 changed files:

- gajim/gtk/chat_list.py
- gajim/gtk/chat_list_row.py


Changes:

=====================================
gajim/gtk/chat_list.py
=====================================
@@ -59,7 +59,7 @@ def __init__(self, workspace_id: str) -> None:
         EventHelper.__init__(self)
         self._workspace_id = workspace_id
 
-        self._chats: dict[tuple[str, JID], Any] = {}
+        self._chats: dict[tuple[str, JID], ChatListRow] = {}
         self._current_filter: str = 'all'
         self._current_filter_text: str = ''
 
@@ -98,7 +98,7 @@ def __init__(self, workspace_id: str) -> None:
         self.connect('drag-data-received', self._on_drag_data_received)
         self.connect('destroy', self._on_destroy)
 
-        self._timer_id = GLib.timeout_add_seconds(60, self._update_time)
+        self._timer_id = GLib.timeout_add_seconds(60, self._update_row_state)
 
         self.show_all()
 
@@ -455,9 +455,9 @@ def _change_pinned_order(self, row_before: ChatListRow | 
None) -> None:
         self.invalidate_sort()
         self._pinned_order_change = False
 
-    def _update_time(self) -> bool:
+    def _update_row_state(self) -> bool:
         for row in self._chats.values():
-            row.update_time()
+            row.update_state()
         return True
 
     def _filter_func(self, row: ChatListRow) -> bool:


=====================================
gajim/gtk/chat_list_row.py
=====================================
@@ -357,6 +357,10 @@ def update_time(self) -> None:
         self._ui.timestamp_label.set_text(
             get_uf_relative_time(datetime.fromtimestamp(self.timestamp)))
 
+    def update_state(self) -> None:
+        self.update_time()
+        self._ui.mute_image.set_visible(self.contact.is_muted)
+
     def add_unread(self, text: str) -> None:
         self._unread_count += 1
         self._update_unread()



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

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/6767244a98172e1bf148526f72189dd4236d6ea0
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to