* Don't set urgency hint for notifications, even if
notify_on_all_muc_messages is set.
This commit is contained in:
parent
37780f6b72
commit
87567bfda0
17
src/chat.py
17
src/chat.py
|
@ -126,7 +126,7 @@ class Chat:
|
||||||
self.print_time_timeout,
|
self.print_time_timeout,
|
||||||
jid)
|
jid)
|
||||||
|
|
||||||
def show_title(self):
|
def show_title(self, urgent = True):
|
||||||
"""redraw the window's title"""
|
"""redraw the window's title"""
|
||||||
unread = 0
|
unread = 0
|
||||||
for jid in self.nb_unread:
|
for jid in self.nb_unread:
|
||||||
|
@ -158,7 +158,8 @@ class Chat:
|
||||||
title += ' (' + _('account: ') + self.account + ')'
|
title += ' (' + _('account: ') + self.account + ')'
|
||||||
|
|
||||||
self.window.set_title(title)
|
self.window.set_title(title)
|
||||||
gtkgui_helpers.set_unset_urgency_hint(self.window, unread)
|
if urgent:
|
||||||
|
gtkgui_helpers.set_unset_urgency_hint(self.window, unread)
|
||||||
|
|
||||||
def redraw_tab(self, jid, chatstate = None):
|
def redraw_tab(self, jid, chatstate = None):
|
||||||
'''redraw the label of the tab
|
'''redraw the label of the tab
|
||||||
|
@ -1229,20 +1230,22 @@ class Chat:
|
||||||
return
|
return
|
||||||
if kind == 'incoming' and update_time:
|
if kind == 'incoming' and update_time:
|
||||||
gajim.last_message_time[self.account][jid] = time.time()
|
gajim.last_message_time[self.account][jid] = time.time()
|
||||||
|
urgent = True
|
||||||
if (jid != self.get_active_jid() or \
|
if (jid != self.get_active_jid() or \
|
||||||
not self.window.is_active() or \
|
not self.window.is_active() or \
|
||||||
not end) and kind == 'incoming':
|
not end) and kind == 'incoming':
|
||||||
if self.widget_name == 'groupchat_window' and\
|
if self.widget_name == 'groupchat_window':
|
||||||
not gajim.config.get('notify_on_all_muc_messages'):
|
|
||||||
# Do not notify us for gc messages that are not for us
|
|
||||||
if text.find(self.nicks[jid]) == -1:
|
if text.find(self.nicks[jid]) == -1:
|
||||||
return
|
# Do not notify us for gc messages that are not for us
|
||||||
|
urgent = False
|
||||||
|
if not gajim.config.get('notify_on_all_muc_messages'):
|
||||||
|
return
|
||||||
self.nb_unread[jid] += 1
|
self.nb_unread[jid] += 1
|
||||||
if self.plugin.systray_enabled and gajim.config.get(
|
if self.plugin.systray_enabled and gajim.config.get(
|
||||||
'trayicon_notification_on_new_messages'):
|
'trayicon_notification_on_new_messages'):
|
||||||
self.plugin.systray.add_jid(jid, self.account)
|
self.plugin.systray.add_jid(jid, self.account)
|
||||||
self.redraw_tab(jid)
|
self.redraw_tab(jid)
|
||||||
self.show_title()
|
self.show_title(urgent)
|
||||||
|
|
||||||
def save_sent_message(self, jid, message):
|
def save_sent_message(self, jid, message):
|
||||||
#save the message, so user can scroll though the list with key up/down
|
#save the message, so user can scroll though the list with key up/down
|
||||||
|
|
Loading…
Reference in New Issue