Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann Leboulanger <asterix@lagaule.org>2006-11-11 02:17:52 +0300
committerYann Leboulanger <asterix@lagaule.org>2006-11-11 02:17:52 +0300
commit0e092980fdded6f47ab8f6c08625ba2c08e7a1cd (patch)
treebb29fbb8c462246693a81b713ec3bc234d6171e6
parentf4a3bf3ee482a16dbd2a2604abe9c0133f73f7a3 (diff)
show unread pm in tab and in chat window title. fixes #2645
-rw-r--r--src/groupchat_control.py12
-rw-r--r--src/message_window.py6
2 files changed, 12 insertions, 6 deletions
diff --git a/src/groupchat_control.py b/src/groupchat_control.py
index a99629f22..a78830a84 100644
--- a/src/groupchat_control.py
+++ b/src/groupchat_control.py
@@ -395,9 +395,7 @@ class GroupchatControl(ChatControlBase):
# 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 @@ class GroupchatControl(ChatControlBase):
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 @@ class GroupchatControl(ChatControlBase):
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 @@ class GroupchatControl(ChatControlBase):
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']))
diff --git a/src/message_window.py b/src/message_window.py
index 187b20071..2ca82cef8 100644
--- a/src/message_window.py
+++ b/src/message_window.py
@@ -238,8 +238,10 @@ class MessageWindow:
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()