stop message archiving for encrypted sessions. Fixes #5792

This commit is contained in:
Yann Leboulanger 2010-06-27 22:31:55 +02:00
parent 60d9b234a7
commit af804641b6
2 changed files with 14 additions and 0 deletions

View File

@ -76,6 +76,13 @@ class ConnectionArchive:
item.setAttr('jid', jid)
self.connection.send(iq_)
def stop_archiving_session(self, thread_id):
iq_ = common.xmpp.Iq('set')
pref = iq_.setTag('pref', namespace=common.xmpp.NS_ARCHIVE)
session = pref.setTag('session', attrs={'thread': thread_id,
'save': 'false', 'otr': 'concede'})
self.connection.send(iq_)
def get_item_pref(self, jid):
jid = common.xmpp.JID(jid)
if unicode(jid) in self.items:

View File

@ -287,6 +287,9 @@ class ArchivingStanzaSession(StanzaSession):
if self.control:
self.control.print_archiving_session_details()
def stop_archiving_for_session(self):
self.conn.stop_archiving_session(self.thread_id)
class EncryptedStanzaSession(ArchivingStanzaSession):
"""
@ -1035,6 +1038,8 @@ class EncryptedStanzaSession(ArchivingStanzaSession):
if self.control:
self.control.print_esession_details()
self.stop_archiving_for_session()
def final_steps_alice(self, form):
srs = ''
srses = secrets.secrets().retained_secrets(self.conn.name,
@ -1075,6 +1080,8 @@ class EncryptedStanzaSession(ArchivingStanzaSession):
if self.control:
self.control.print_esession_details()
self.stop_archiving_for_session()
def do_retained_secret(self, k, old_srs):
"""
Calculate the new retained secret. determine if the user needs to check