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:
Goffi 2013-02-22 00:15:50 +01:00
commit d339e79b1c
3 changed files with 14 additions and 9 deletions

View file

@ -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()