| ... |
... |
@@ -557,6 +557,7 @@ def __init__(self, workspace_id: str, account: str, jid: JID, type_: str, |
|
557
|
557
|
self.stanza_id: Optional[str] = None
|
|
558
|
558
|
self.message_id: Optional[str] = None
|
|
559
|
559
|
self._unread_count: int = 0
|
|
|
560
|
+ self._needs_muc_highlight: bool = False
|
|
560
|
561
|
self._pinned: bool = pinned
|
|
561
|
562
|
|
|
562
|
563
|
self.get_style_context().add_class('chatlist-row')
|
| ... |
... |
@@ -788,7 +789,8 @@ def get_real_unread_count(self) -> int: |
|
788
|
789
|
|
|
789
|
790
|
@property
|
|
790
|
791
|
def unread_count(self) -> int:
|
|
791
|
|
- if self.contact.is_groupchat and not self.contact.can_notify():
|
|
|
792
|
+ if (self.contact.is_groupchat and not self.contact.can_notify() and
|
|
|
793
|
+ not self._needs_muc_highlight):
|
|
792
|
794
|
return 0
|
|
793
|
795
|
return self._unread_count
|
|
794
|
796
|
|
| ... |
... |
@@ -817,8 +819,6 @@ def add_unread(self, text: str) -> None: |
|
817
|
819
|
|
|
818
|
820
|
self._unread_count += 1
|
|
819
|
821
|
self._update_unread()
|
|
820
|
|
- chat_list = cast(ChatList, self.get_parent())
|
|
821
|
|
- chat_list.emit_unread_changed()
|
|
822
|
822
|
app.storage.cache.set_unread_count(
|
|
823
|
823
|
self.account,
|
|
824
|
824
|
self.jid,
|
| ... |
... |
@@ -832,10 +832,15 @@ def add_unread(self, text: str) -> None: |
|
832
|
832
|
self.contact.nickname,
|
|
833
|
833
|
self._client.get_own_jid().bare)
|
|
834
|
834
|
if needs_highlight:
|
|
|
835
|
+ self._needs_muc_highlight = True
|
|
835
|
836
|
self._ui.unread_label.get_style_context().remove_class(
|
|
836
|
837
|
'unread-counter-silent')
|
|
837
|
838
|
|
|
|
839
|
+ chat_list = cast(ChatList, self.get_parent())
|
|
|
840
|
+ chat_list.emit_unread_changed()
|
|
|
841
|
+
|
|
838
|
842
|
def reset_unread(self) -> None:
|
|
|
843
|
+ self._needs_muc_highlight = False
|
|
839
|
844
|
self._unread_count = 0
|
|
840
|
845
|
self._update_unread()
|
|
841
|
846
|
chat_list = cast(ChatList, self.get_parent())
|