stop message archiving for encrypted sessions. Fixes #5792
This commit is contained in:
parent
60d9b234a7
commit
af804641b6
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue