send_message now accepts type of message

This commit is contained in:
Nikos Kouremenos 2005-06-30 22:37:33 +00:00
parent 3b347a9b9c
commit 64bfb68c22
1 changed files with 2 additions and 2 deletions

View File

@ -829,7 +829,7 @@ class Connection:
self.connection.send(p) self.connection.send(p)
self.dispatch('STATUS', show) self.dispatch('STATUS', show)
def send_message(self, jid, msg, keyID): def send_message(self, jid, msg, keyID, type = 'chat'):
if not self.connection: if not self.connection:
return return
if not msg: if not msg:
@ -840,7 +840,7 @@ class Connection:
#encrypt #encrypt
msgenc = self.gpg.encrypt(msg, [keyID]) msgenc = self.gpg.encrypt(msg, [keyID])
if msgenc: msgtxt = _('[this message is encrypted]') if msgenc: msgtxt = _('[this message is encrypted]')
msg_iq = common.xmpp.Message(to = jid, body = msgtxt, typ = 'chat') msg_iq = common.xmpp.Message(to = jid, body = msgtxt, typ = type)
if msgenc: if msgenc:
msg_iq.setTag(common.xmpp.NS_ENCRYPTED + ' x').setData(msgenc) msg_iq.setTag(common.xmpp.NS_ENCRYPTED + ' x').setData(msgenc)
self.to_be_sent.insert(0, msg_iq) self.to_be_sent.insert(0, msg_iq)