don't count pm messages in roster window, but in groupchat window. Fixes #2401

This commit is contained in:
Yann Leboulanger 2006-09-07 14:35:23 +00:00
parent b3957742d4
commit 29cef733f2
3 changed files with 12 additions and 3 deletions

View File

@ -85,8 +85,6 @@ class ChatControlBase(MessageControl):
if self.resource:
jid += '/' + self.resource
type_ = self.type_id
if type_ == message_control.TYPE_GC:
type_ = 'gc_msg'
return len(gajim.events.get_events(self.account, jid, ['printed_' + type_,
type_]))

View File

@ -555,6 +555,14 @@ class GroupchatControl(ChatControlBase):
ChatControlBase.print_conversation_line(self, text, kind, contact, tim,
other_tags_for_name, [], other_tags_for_text)
def get_nb_unread(self):
nb = len(gajim.events.get_events(self.account, self.room_jid,
['printed_gc_msg']))
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']))
return nb
def highlighting_for_message(self, text, tim):
'''Returns a 2-Tuple. The first says whether or not to highlight the
text, the second, what sound to play.'''

View File

@ -3563,7 +3563,10 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
change_title_allowed = gajim.config.get('change_roster_title')
if change_title_allowed:
start = ''
nb_unread = gajim.events.get_nb_events()
nb_unread = gajim.events.get_nb_events(['chat', 'normal',
'file-request', 'file-error', 'file-completed',
'file-request-error', 'file-send-error', 'file-stopped', 'gc_msg',
'printed_chat', 'printed_gc_msg'])
if nb_unread > 1:
start = '[' + str(nb_unread) + '] '
elif nb_unread == 1: