Call notify check methods with JID arg
For subscription requests we dont have a contact obj
This commit is contained in:
parent
7fa4c9e1c2
commit
5bc9822cec
|
@ -1022,9 +1022,9 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
|
||||||
event_type = events.PrintedPmEvent
|
event_type = events.PrintedPmEvent
|
||||||
event = 'message_received'
|
event = 'message_received'
|
||||||
show_in_roster = notify.get_show_in_roster(event,
|
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,
|
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,
|
event = event_type(text, subject, self, msg_log_id,
|
||||||
show_in_roster=show_in_roster,
|
show_in_roster=show_in_roster,
|
||||||
|
|
|
@ -38,7 +38,7 @@ from gajim.common import helpers
|
||||||
from gajim.common import ged
|
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
|
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
|
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
|
Return True if this event must be shown in systray, else False
|
||||||
"""
|
"""
|
||||||
|
|
||||||
notify = app.config.get('notify_on_all_muc_messages')
|
notify = app.config.get('notify_on_all_muc_messages')
|
||||||
notify_for_jid = app.config.get_per(
|
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:
|
if type_ == 'printed_gc_msg' and not notify and not notify_for_jid:
|
||||||
# it's not an highlighted message, don't show in systray
|
# it's not an highlighted message, don't show in systray
|
||||||
|
|
|
@ -280,9 +280,9 @@ class ChatControlSession(object):
|
||||||
else:
|
else:
|
||||||
# Everything else
|
# Everything else
|
||||||
obj.show_in_roster = notify.get_show_in_roster(event_type,
|
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,
|
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:
|
if obj.mtype == 'normal' and obj.popup:
|
||||||
do_event = False
|
do_event = False
|
||||||
else:
|
else:
|
||||||
|
@ -388,9 +388,9 @@ class ChatControlSession(object):
|
||||||
event_type = 'single_message_received'
|
event_type = 'single_message_received'
|
||||||
|
|
||||||
show_in_roster = notify.get_show_in_roster(event_type, self.conn.name,
|
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,
|
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,
|
event = event_t(msg, subject, msg_type, tim, encrypted, resource,
|
||||||
msg_log_id, xhtml=xhtml, session=self, form_node=form_node,
|
msg_log_id, xhtml=xhtml, session=self, form_node=form_node,
|
||||||
|
|
|
@ -27,8 +27,8 @@ def notify(event, jid, account, parameters, advanced_notif_num = None):
|
||||||
def get_advanced_notification(event, account, contact):
|
def get_advanced_notification(event, account, contact):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def get_show_in_roster(event, account, contact, session = None):
|
def get_show_in_roster(event, account, jid, session=None):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def get_show_in_systray(event, account, contact, type_ = None):
|
def get_show_in_systray(event, account, jid, type_=None):
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Reference in New Issue