Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gajim
gajim
Commits
e8fa5a91
Commit
e8fa5a91
authored
May 14, 2022
by
Daniel Brötzmann
Browse files
fix: Update unread counter on mention in public MUCs
Fixes
#10810
parent
d5368d36
Changes
1
Hide whitespace changes
Inline
Side-by-side
gajim/gtk/chat_list.py
View file @
e8fa5a91
...
...
@@ -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
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment