diff --git a/gajim/chat_control_base.py b/gajim/chat_control_base.py index c73f3d6df..155607eb8 100644 --- a/gajim/chat_control_base.py +++ b/gajim/chat_control_base.py @@ -1022,9 +1022,9 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools): event_type = events.PrintedPmEvent event = 'message_received' show_in_roster = notify.get_show_in_roster(event, - self.account, self.contact, self.session) + self.account, self.contact.jid, self.session) show_in_systray = notify.get_show_in_systray(event, - self.account, self.contact, event_type.type_) + self.account, self.contact.jid, event_type.type_) event = event_type(text, subject, self, msg_log_id, show_in_roster=show_in_roster, diff --git a/gajim/notify.py b/gajim/notify.py index 650ed51c3..c1e9260b1 100644 --- a/gajim/notify.py +++ b/gajim/notify.py @@ -38,7 +38,7 @@ from gajim.common import helpers from gajim.common import ged -def get_show_in_roster(event, account, contact, session=None): +def get_show_in_roster(event, account, jid, session=None): """ Return True if this event must be shown in roster, else False """ @@ -50,14 +50,14 @@ def get_show_in_roster(event, account, contact, session=None): return True -def get_show_in_systray(event, account, contact, type_=None): +def get_show_in_systray(event, account, jid, type_=None): """ Return True if this event must be shown in systray, else False """ notify = app.config.get('notify_on_all_muc_messages') notify_for_jid = app.config.get_per( - 'rooms', contact.jid, 'notify_on_all_messages') + 'rooms', jid, 'notify_on_all_messages') if type_ == 'printed_gc_msg' and not notify and not notify_for_jid: # it's not an highlighted message, don't show in systray diff --git a/gajim/session.py b/gajim/session.py index 7fd5a981e..c5897f907 100644 --- a/gajim/session.py +++ b/gajim/session.py @@ -280,9 +280,9 @@ class ChatControlSession(object): else: # Everything else obj.show_in_roster = notify.get_show_in_roster(event_type, - self.conn.name, contact, self) + self.conn.name, contact.jid, self) obj.show_in_systray = notify.get_show_in_systray(event_type, - self.conn.name, contact) + self.conn.name, contact.jid) if obj.mtype == 'normal' and obj.popup: do_event = False else: @@ -388,9 +388,9 @@ class ChatControlSession(object): event_type = 'single_message_received' show_in_roster = notify.get_show_in_roster(event_type, self.conn.name, - contact, self) + contact.jid, self) show_in_systray = notify.get_show_in_systray(event_type, self.conn.name, - contact) + contact.jid) event = event_t(msg, subject, msg_type, tim, encrypted, resource, msg_log_id, xhtml=xhtml, session=self, form_node=form_node, diff --git a/test/lib/notify.py b/test/lib/notify.py index 9bf59ea83..2dd7e2628 100644 --- a/test/lib/notify.py +++ b/test/lib/notify.py @@ -27,8 +27,8 @@ def notify(event, jid, account, parameters, advanced_notif_num = None): def get_advanced_notification(event, account, contact): return None -def get_show_in_roster(event, account, contact, session = None): +def get_show_in_roster(event, account, jid, session=None): return True -def get_show_in_systray(event, account, contact, type_ = None): +def get_show_in_systray(event, account, jid, type_=None): return True