notify on begin/end encryption

This commit is contained in:
Brendan Taylor 2007-08-17 17:26:05 +00:00
parent f93276c1a9
commit e1c4d80e65
1 changed files with 3 additions and 1 deletions

View File

@ -1450,8 +1450,11 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
if msg.getTag('init') and msg.getTag('init').namespace == 'http://www.xmpp.org/extensions/xep-0116.html#ns-init': if msg.getTag('init') and msg.getTag('init').namespace == 'http://www.xmpp.org/extensions/xep-0116.html#ns-init':
self._InitE2ECB(con, msg, session) self._InitE2ECB(con, msg, session)
encrypted = False
e2eTag = msg.getTag('c', namespace = common.xmpp.NS_STANZA_CRYPTO) e2eTag = msg.getTag('c', namespace = common.xmpp.NS_STANZA_CRYPTO)
if e2eTag: if e2eTag:
encrypted = True
msg = session.decrypt_stanza(msg) msg = session.decrypt_stanza(msg)
msgtxt = msg.getBody() msgtxt = msg.getBody()
@ -1461,7 +1464,6 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
tim = time.strptime(tim, '%Y%m%dT%H:%M:%S') tim = time.strptime(tim, '%Y%m%dT%H:%M:%S')
tim = time.localtime(timegm(tim)) tim = time.localtime(timegm(tim))
jid = helpers.get_jid_from_iq(msg) jid = helpers.get_jid_from_iq(msg)
encrypted = False
chatstate = None chatstate = None
encTag = msg.getTag('x', namespace = common.xmpp.NS_ENCRYPTED) encTag = msg.getTag('x', namespace = common.xmpp.NS_ENCRYPTED)
decmsg = '' decmsg = ''