Give the concerned tab to the _msg handlers
This commit is contained in:
parent
cc7f010aed
commit
5e840e6437
1 changed files with 8 additions and 4 deletions
10
src/core.py
10
src/core.py
|
@ -567,7 +567,7 @@ class Core(object):
|
||||||
tab = self.open_private_window(room_from, nick_from, False)
|
tab = self.open_private_window(room_from, nick_from, False)
|
||||||
if not tab:
|
if not tab:
|
||||||
return
|
return
|
||||||
self.events.trigger('private_msg', message)
|
self.events.trigger('private_msg', message, tab)
|
||||||
if not body:
|
if not body:
|
||||||
return
|
return
|
||||||
tab.add_message(body, time=None, nickname=nick_from,
|
tab.add_message(body, time=None, nickname=nick_from,
|
||||||
|
@ -616,13 +616,17 @@ class Core(object):
|
||||||
When receiving "normal" messages (from someone in our roster)
|
When receiving "normal" messages (from someone in our roster)
|
||||||
"""
|
"""
|
||||||
jid = message['from']
|
jid = message['from']
|
||||||
self.events.trigger('conversation_msg', message)
|
|
||||||
body = xhtml.get_body_from_message_stanza(message)
|
body = xhtml.get_body_from_message_stanza(message)
|
||||||
|
conversation = self.get_tab_of_conversation_with_jid(jid, create=False)
|
||||||
if not body:
|
if not body:
|
||||||
if message['type'] == 'error':
|
if message['type'] == 'error':
|
||||||
self.information(self.get_error_message_from_error_stanza(message), 'Error')
|
self.information(self.get_error_message_from_error_stanza(message), 'Error')
|
||||||
return
|
return
|
||||||
|
elif not conversation:
|
||||||
|
return
|
||||||
conversation = self.get_tab_of_conversation_with_jid(jid, create=True)
|
conversation = self.get_tab_of_conversation_with_jid(jid, create=True)
|
||||||
|
self.events.trigger('conversation_msg', message, conversation)
|
||||||
|
body = xhtml.get_body_from_message_stanza(message)
|
||||||
if roster.get_contact_by_jid(jid.bare):
|
if roster.get_contact_by_jid(jid.bare):
|
||||||
remote_nick = roster.get_contact_by_jid(jid.bare).get_name() or jid.user
|
remote_nick = roster.get_contact_by_jid(jid.bare).get_name() or jid.user
|
||||||
else:
|
else:
|
||||||
|
@ -1057,7 +1061,7 @@ class Core(object):
|
||||||
if tab.get_user_by_name(nick_from) and\
|
if tab.get_user_by_name(nick_from) and\
|
||||||
tab.get_user_by_name(nick_from) in tab.ignores:
|
tab.get_user_by_name(nick_from) in tab.ignores:
|
||||||
return
|
return
|
||||||
self.events.trigger('muc_msg', message)
|
self.events.trigger('muc_msg', message, tab)
|
||||||
body = xhtml.get_body_from_message_stanza(message)
|
body = xhtml.get_body_from_message_stanza(message)
|
||||||
if body:
|
if body:
|
||||||
date = date if delayed == True else None
|
date = date if delayed == True else None
|
||||||
|
|
Loading…
Reference in a new issue