notify_on_all_muc_messges fix; #1395

This commit is contained in:
Travis Shirk 2006-01-14 19:16:16 +00:00
parent b940e12aee
commit a923b1c230
3 changed files with 13 additions and 5 deletions

View file

@ -350,12 +350,11 @@ class ChatControlBase(MessageControl):
gajim.last_message_time[self.account][jid] = time.time()
urgent = True
if (not 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\
kind in ('incoming', 'incoming_queue'):
jid != self.parent_win.get_active_jid() or \
not self.parent_win.is_active() or not end) and\
kind in ('incoming', 'incoming_queue'):
self.nb_unread += 1
if gajim.interface.systray_enabled and\
gajim.config.get('trayicon_notification_on_new_messages'):
if gajim.interface.systray_enabled and self.notify_on_new_messages():
gajim.interface.systray.add_jid(jid, self.account, self.type_id)
self.parent_win.redraw_tab(self.contact)
self.parent_win.show_title(urgent)
@ -695,6 +694,9 @@ class ChatControl(ChatControlBase):
# restore previous 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):
'''we enter the eventbox area so we under conditions add a timeout
to show a bigger avatar after 0.5 sec'''

View file

@ -176,6 +176,9 @@ class GroupchatControl(ChatControlBase):
self.conv_textview.grab_focus()
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):
'''When window gets focus'''
if self.parent_win.get_active_jid() == self.room_jid:

View file

@ -70,6 +70,9 @@ class MessageControl:
def shutdown(self):
# NOTE: Derived classes MUST implement this
pass
def notify_on_new_messages(self):
# NOTE: Derived classes MUST implement this
return False
def repaint_themed_widgets(self, theme):
pass # NOTE: Derived classes SHOULD implement this
def update_ui(self):