notify_on_all_muc_messges fix; #1395
This commit is contained in:
parent
b940e12aee
commit
a923b1c230
3 changed files with 13 additions and 5 deletions
|
@ -350,12 +350,11 @@ class ChatControlBase(MessageControl):
|
||||||
gajim.last_message_time[self.account][jid] = time.time()
|
gajim.last_message_time[self.account][jid] = time.time()
|
||||||
urgent = True
|
urgent = True
|
||||||
if (not self.parent_win.get_active_jid() or\
|
if (not self.parent_win.get_active_jid() or\
|
||||||
jid != self.parent_win.get_active_jid() or \
|
jid != self.parent_win.get_active_jid() or \
|
||||||
not self.parent_win.is_active() or not end) and\
|
not self.parent_win.is_active() or not end) and\
|
||||||
kind in ('incoming', 'incoming_queue'):
|
kind in ('incoming', 'incoming_queue'):
|
||||||
self.nb_unread += 1
|
self.nb_unread += 1
|
||||||
if gajim.interface.systray_enabled and\
|
if gajim.interface.systray_enabled and self.notify_on_new_messages():
|
||||||
gajim.config.get('trayicon_notification_on_new_messages'):
|
|
||||||
gajim.interface.systray.add_jid(jid, self.account, self.type_id)
|
gajim.interface.systray.add_jid(jid, self.account, self.type_id)
|
||||||
self.parent_win.redraw_tab(self.contact)
|
self.parent_win.redraw_tab(self.contact)
|
||||||
self.parent_win.show_title(urgent)
|
self.parent_win.show_title(urgent)
|
||||||
|
@ -695,6 +694,9 @@ class ChatControl(ChatControlBase):
|
||||||
# restore previous conversation
|
# restore previous conversation
|
||||||
self.restore_conversation()
|
self.restore_conversation()
|
||||||
|
|
||||||
|
def notify_on_new_messages(self):
|
||||||
|
return gajim.config.get('trayicon_notification_on_new_messages')
|
||||||
|
|
||||||
def on_avatar_eventbox_enter_notify_event(self, widget, event):
|
def on_avatar_eventbox_enter_notify_event(self, widget, event):
|
||||||
'''we enter the eventbox area so we under conditions add a timeout
|
'''we enter the eventbox area so we under conditions add a timeout
|
||||||
to show a bigger avatar after 0.5 sec'''
|
to show a bigger avatar after 0.5 sec'''
|
||||||
|
|
|
@ -176,6 +176,9 @@ class GroupchatControl(ChatControlBase):
|
||||||
self.conv_textview.grab_focus()
|
self.conv_textview.grab_focus()
|
||||||
self.widget.show_all()
|
self.widget.show_all()
|
||||||
|
|
||||||
|
def notify_on_new_messages(self):
|
||||||
|
return gajim.config.get('notify_on_all_muc_messages') or self.attention_flag
|
||||||
|
|
||||||
def _on_window_focus_in_event(self, widget, event):
|
def _on_window_focus_in_event(self, widget, event):
|
||||||
'''When window gets focus'''
|
'''When window gets focus'''
|
||||||
if self.parent_win.get_active_jid() == self.room_jid:
|
if self.parent_win.get_active_jid() == self.room_jid:
|
||||||
|
|
|
@ -70,6 +70,9 @@ class MessageControl:
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
# NOTE: Derived classes MUST implement this
|
# NOTE: Derived classes MUST implement this
|
||||||
pass
|
pass
|
||||||
|
def notify_on_new_messages(self):
|
||||||
|
# NOTE: Derived classes MUST implement this
|
||||||
|
return False
|
||||||
def repaint_themed_widgets(self, theme):
|
def repaint_themed_widgets(self, theme):
|
||||||
pass # NOTE: Derived classes SHOULD implement this
|
pass # NOTE: Derived classes SHOULD implement this
|
||||||
def update_ui(self):
|
def update_ui(self):
|
||||||
|
|
Loading…
Add table
Reference in a new issue