Mercurial > libervia-backend
diff src/sat.tac @ 260:c8406fe5e81e
Added SMTP server plugin, for sending messages from classic MUA \o/
- added subject managing in sendMessage
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 18 Jan 2011 03:59:59 +0100 |
parents | 012c38b56cdd |
children | af3d4f11fe43 |
line wrap: on
line diff
--- a/src/sat.tac Tue Jan 18 01:07:12 2011 +0100 +++ b/src/sat.tac Tue Jan 18 03:59:59 2011 +0100 @@ -591,7 +591,7 @@ ## 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 @@ 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))