send_message now accepts type of message
This commit is contained in:
parent
3b347a9b9c
commit
64bfb68c22
|
@ -829,7 +829,7 @@ class Connection:
|
|||
self.connection.send(p)
|
||||
self.dispatch('STATUS', show)
|
||||
|
||||
def send_message(self, jid, msg, keyID):
|
||||
def send_message(self, jid, msg, keyID, type = 'chat'):
|
||||
if not self.connection:
|
||||
return
|
||||
if not msg:
|
||||
|
@ -840,7 +840,7 @@ class Connection:
|
|||
#encrypt
|
||||
msgenc = self.gpg.encrypt(msg, [keyID])
|
||||
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:
|
||||
msg_iq.setTag(common.xmpp.NS_ENCRYPTED + ' x').setData(msgenc)
|
||||
self.to_be_sent.insert(0, msg_iq)
|
||||
|
|
Loading…
Reference in New Issue