Added SMTP server plugin, for sending messages from classic MUA \o/
- added subject managing in sendMessage
This commit is contained in:
parent
d1ae81f4c7
commit
59d6090e73
1 changed files with 215 additions and 6 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Reference in a new issue