core: sendMessage refactoring:
- sendMessage now use JID instead of unicode, bridge method using unicode is now _sendMessage
- added no_trigger argument, so it's now possible to forbid trigger execution (to avoid any plugin when we send a message)
This commit is contained in:
parent
dfe67edc26
commit
d339e79b1c
2 changed files with 14 additions and 9 deletions
|
|
@ -94,7 +94,7 @@ class Exp_Parrot(object):
|
|||
|
||||
linked = _links[from_jid.userhostJID()]
|
||||
|
||||
self.host.sendMessage(unicode(linked), msg, None, "auto", profile_key=profile)
|
||||
self.host._sendMessage(unicode(linked), msg, None, "auto", profile_key=profile)
|
||||
else:
|
||||
warning("No body element found in message, following normal behaviour")
|
||||
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ class SatSmtpMessage(object):
|
|||
"""handle end of message"""
|
||||
mail = Parser().parsestr("\n".join(self.message))
|
||||
try:
|
||||
self.host.sendMessage(parseaddr(mail['to'].decode('utf-8', 'replace'))[1], mail.get_payload().decode('utf-8', 'replace'), # TODO: manage other charsets
|
||||
self.host._sendMessage(parseaddr(mail['to'].decode('utf-8', 'replace'))[1], mail.get_payload().decode('utf-8', 'replace'), # TODO: manage other charsets
|
||||
subject=mail['subject'].decode('utf-8', 'replace'), mess_type='normal', profile_key=self.profile)
|
||||
except:
|
||||
exc_type, exc_value, exc_traceback = sys.exc_info()
|
||||
|
|
|
|||
Loading…
Reference in a new issue