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


Commits:
e8fa5a91 by wurstsalat at 2022-05-14T17:34:09+02:00
fix: Update unread counter on mention in public MUCs

Fixes #10810

- - - - -


1 changed file:

- gajim/gtk/chat_list.py


Changes:

=====================================
gajim/gtk/chat_list.py
=====================================
@@ -557,6 +557,7 @@ def __init__(self, workspace_id: str, account: str, jid: 
JID, type_: str,
         self.stanza_id: Optional[str] = None
         self.message_id: Optional[str] = None
         self._unread_count: int = 0
+        self._needs_muc_highlight: bool = False
         self._pinned: bool = pinned
 
         self.get_style_context().add_class('chatlist-row')
@@ -788,7 +789,8 @@ def get_real_unread_count(self) -> int:
 
     @property
     def unread_count(self) -> int:
-        if self.contact.is_groupchat and not self.contact.can_notify():
+        if (self.contact.is_groupchat and not self.contact.can_notify() and
+                not self._needs_muc_highlight):
             return 0
         return self._unread_count
 
@@ -817,8 +819,6 @@ def add_unread(self, text: str) -> None:
 
         self._unread_count += 1
         self._update_unread()
-        chat_list = cast(ChatList, self.get_parent())
-        chat_list.emit_unread_changed()
         app.storage.cache.set_unread_count(
             self.account,
             self.jid,
@@ -832,10 +832,15 @@ def add_unread(self, text: str) -> None:
                 self.contact.nickname,
                 self._client.get_own_jid().bare)
             if needs_highlight:
+                self._needs_muc_highlight = True
                 self._ui.unread_label.get_style_context().remove_class(
                     'unread-counter-silent')
 
+        chat_list = cast(ChatList, self.get_parent())
+        chat_list.emit_unread_changed()
+
     def reset_unread(self) -> None:
+        self._needs_muc_highlight = False
         self._unread_count = 0
         self._update_unread()
         chat_list = cast(ChatList, self.get_parent())



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

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

Reply via email to