don't count pm messages in roster window, but in groupchat window. Fixes #2401
This commit is contained in:
parent
b3957742d4
commit
29cef733f2
|
@ -85,8 +85,6 @@ class ChatControlBase(MessageControl):
|
||||||
if self.resource:
|
if self.resource:
|
||||||
jid += '/' + self.resource
|
jid += '/' + self.resource
|
||||||
type_ = self.type_id
|
type_ = self.type_id
|
||||||
if type_ == message_control.TYPE_GC:
|
|
||||||
type_ = 'gc_msg'
|
|
||||||
return len(gajim.events.get_events(self.account, jid, ['printed_' + type_,
|
return len(gajim.events.get_events(self.account, jid, ['printed_' + type_,
|
||||||
type_]))
|
type_]))
|
||||||
|
|
||||||
|
|
|
@ -555,6 +555,14 @@ class GroupchatControl(ChatControlBase):
|
||||||
ChatControlBase.print_conversation_line(self, text, kind, contact, tim,
|
ChatControlBase.print_conversation_line(self, text, kind, contact, tim,
|
||||||
other_tags_for_name, [], other_tags_for_text)
|
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):
|
def highlighting_for_message(self, text, tim):
|
||||||
'''Returns a 2-Tuple. The first says whether or not to highlight the
|
'''Returns a 2-Tuple. The first says whether or not to highlight the
|
||||||
text, the second, what sound to play.'''
|
text, the second, what sound to play.'''
|
||||||
|
|
|
@ -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')
|
change_title_allowed = gajim.config.get('change_roster_title')
|
||||||
if change_title_allowed:
|
if change_title_allowed:
|
||||||
start = ''
|
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:
|
if nb_unread > 1:
|
||||||
start = '[' + str(nb_unread) + '] '
|
start = '[' + str(nb_unread) + '] '
|
||||||
elif nb_unread == 1:
|
elif nb_unread == 1:
|
||||||
|
|
Loading…
Reference in New Issue