Added SMTP server plugin, for sending messages from classic MUA \o/

- added subject managing in sendMessage
This commit is contained in:
Goffi 2011-01-18 03:59:59 +01:00
commit 59d6090e73

View file

@ -591,7 +591,7 @@ class SAT(service.Service):
## jabber methods ##
def sendMessage(self,to,msg,type='chat', profile_key='@DEFAULT@'):
def sendMessage(self, to, msg, subject=None, type='chat', profile_key='@DEFAULT@'):
#FIXME: check validity of recipient
profile = self.memory.getProfileName(profile_key)
assert(profile)
@ -601,6 +601,8 @@ class SAT(service.Service):
message["to"] = jid.JID(to).full()
message["from"] = current_jid.full()
message["type"] = type
if subject:
message.addElement("subject", "jabber:client", subject)
message.addElement("body", "jabber:client", msg)
self.profiles[profile].xmlstream.send(message)
self.memory.addToHistory(current_jid, current_jid, jid.JID(to), message["type"], unicode(msg))