From 587a4d4e7306feb9c826871d62f75b3a3990ef40 Mon Sep 17 00:00:00 2001 From: Jean-Marie Traissard Date: Wed, 8 Nov 2006 21:28:28 +0000 Subject: [PATCH] Don't count first messages in roster title when we auto open --- src/common/events.py | 4 ++-- src/roster_window.py | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/common/events.py b/src/common/events.py index 470f7cf63..156d58ef6 100644 --- a/src/common/events.py +++ b/src/common/events.py @@ -118,8 +118,8 @@ class Events: if gajim.interface.systray_capabilities: gajim.interface.systray.set_img() - def get_nb_events(self, types = []): - return self._get_nb_events(types = types) + def get_nb_events(self, types = [], account = None): + return self._get_nb_events(types = types, account = account) def get_events(self, account, jid = None, types = []): '''if event is not specified, get all events from this jid, diff --git a/src/roster_window.py b/src/roster_window.py index f2745376b..b86a0358d 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -3962,10 +3962,13 @@ _('If "%s" accepts this request you will know his or her status.') % jid) nb_unread = 0 if change_title_allowed: start = '' - nb_unread = gajim.events.get_nb_events(['chat', 'normal', - 'file-request', 'file-error', 'file-completed', - 'file-request-error', 'file-send-error', 'file-stopped', - 'printed_chat']) + for account in gajim.connections: + # Count events in roster title only if we don't auto open them + if not helpers.allow_popup_window(account): + nb_unread += gajim.events.get_nb_events(['chat', 'normal', + 'file-request', 'file-error', 'file-completed', + 'file-request-error', 'file-send-error', 'file-stopped', + 'printed_chat'], account) if nb_unread > 1: start = '[' + str(nb_unread) + '] ' elif nb_unread == 1: