Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TSRh
gajim
Commits
0e092980
Commit
0e092980
authored
18 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
show unread pm in tab and in chat window title. fixes #2645
parent
f4a3bf3e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/groupchat_control.py
+8
-4
8 additions, 4 deletions
src/groupchat_control.py
src/message_window.py
+4
-2
4 additions, 2 deletions
src/message_window.py
with
12 additions
and
6 deletions
src/groupchat_control.py
+
8
−
4
View file @
0e092980
...
...
@@ -395,9 +395,7 @@ def get_tab_label(self, chatstate):
# count waiting highlighted messages
unread
=
''
jid
=
self
.
contact
.
jid
num_unread
=
len
(
gajim
.
events
.
get_events
(
self
.
account
,
jid
,
[
'
printed_gc_msg
'
]))
num_unread
=
self
.
get_nb_unread
()
if
num_unread
==
1
:
unread
=
'
*
'
elif
num_unread
>
1
:
...
...
@@ -469,7 +467,7 @@ def on_private_message(self, nick, msg, tim, xhtml):
iter
=
self
.
get_contact_iter
(
nick
)
path
=
self
.
list_treeview
.
get_model
().
get_path
(
iter
)
if
not
autopopup
or
(
not
autopopupaway
and
\
gajim
.
connections
[
self
.
account
].
connected
>
2
):
gajim
.
connections
[
self
.
account
].
connected
>
2
):
if
no_queue
:
# We didn't have a queue: we change icons
model
=
self
.
list_treeview
.
get_model
()
state_images
=
\
...
...
@@ -478,6 +476,7 @@ def on_private_message(self, nick, msg, tim, xhtml):
image
=
state_images
[
'
message
'
]
model
[
iter
][
C_IMG
]
=
image
self
.
parent_win
.
show_title
()
self
.
parent_win
.
redraw_tab
(
self
)
else
:
self
.
_start_private_message
(
nick
)
# Scroll to line
...
...
@@ -588,6 +587,11 @@ def print_conversation(self, text, contact = '', tim = None, xhtml = None):
def
get_nb_unread
(
self
):
nb
=
len
(
gajim
.
events
.
get_events
(
self
.
account
,
self
.
room_jid
,
[
'
printed_gc_msg
'
]))
nb
+=
self
.
get_nb_unread_pm
()
return
nb
def
get_nb_unread_pm
(
self
):
nb
=
0
for
nick
in
gajim
.
contacts
.
get_nick_list
(
self
.
account
,
self
.
room_jid
):
nb
+=
len
(
gajim
.
events
.
get_events
(
self
.
account
,
self
.
room_jid
+
'
/
'
+
\
nick
,
[
'
pm
'
]))
...
...
This diff is collapsed.
Click to expand it.
src/message_window.py
+
4
−
2
View file @
0e092980
...
...
@@ -238,8 +238,10 @@ def show_title(self, urgent = True, control = None):
unread
=
0
for
ctrl
in
self
.
controls
():
if
ctrl
.
type_id
==
message_control
.
TYPE_GC
and
not
\
gajim
.
config
.
get
(
'
notify_on_all_muc_messages
'
)
and
not
\
ctrl
.
attention_flag
:
gajim
.
config
.
get
(
'
notify_on_all_muc_messages
'
)
and
not
\
ctrl
.
attention_flag
:
# count only pm messages
unread
+=
ctrl
.
get_nb_unread_pm
()
continue
unread
+=
ctrl
.
get_nb_unread
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment