EncryptedSession cannot be an ArchivingSession
This commit is contained in:
parent
47ff962e5b
commit
d1a9a6983a
|
@ -2060,7 +2060,8 @@ class ChatControl(ChatControlBase):
|
||||||
"""
|
"""
|
||||||
Print esession settings to textview
|
Print esession settings to textview
|
||||||
"""
|
"""
|
||||||
archiving = bool(self.session) and self.session.archiving
|
archiving = bool(self.session) and isinstance(self.session,
|
||||||
|
ArchivingStanzaSession) and self.session.archiving
|
||||||
if archiving:
|
if archiving:
|
||||||
msg = _('This session WILL be archived on server')
|
msg = _('This session WILL be archived on server')
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -287,7 +287,7 @@ class ArchivingStanzaSession(StanzaSession):
|
||||||
self.control.print_archiving_session_details()
|
self.control.print_archiving_session_details()
|
||||||
|
|
||||||
|
|
||||||
class EncryptedStanzaSession(ArchivingStanzaSession):
|
class EncryptedStanzaSession(StanzaSession):
|
||||||
'''
|
'''
|
||||||
An encrypted stanza negotiation has several states. They arerepresented as
|
An encrypted stanza negotiation has several states. They arerepresented as
|
||||||
the following values in the 'status' attribute of the session object:
|
the following values in the 'status' attribute of the session object:
|
||||||
|
@ -313,7 +313,7 @@ class EncryptedStanzaSession(ArchivingStanzaSession):
|
||||||
handle_session_negotiation method.
|
handle_session_negotiation method.
|
||||||
'''
|
'''
|
||||||
def __init__(self, conn, jid, thread_id, type_='chat'):
|
def __init__(self, conn, jid, thread_id, type_='chat'):
|
||||||
ArchivingStanzaSession.__init__(self, conn, jid, thread_id, type_='chat')
|
StanzaSession.__init__(self, conn, jid, thread_id, type_='chat')
|
||||||
|
|
||||||
self.xes = {}
|
self.xes = {}
|
||||||
self.es = {}
|
self.es = {}
|
||||||
|
|
|
@ -166,11 +166,13 @@ class MessageControl:
|
||||||
|
|
||||||
crypto_changed = bool(session and isinstance(session,
|
crypto_changed = bool(session and isinstance(session,
|
||||||
EncryptedStanzaSession) and session.enable_encryption) != \
|
EncryptedStanzaSession) and session.enable_encryption) != \
|
||||||
bool(oldsession and oldsession.enable_encryption)
|
bool(oldsession and isinstance(oldsession, EncryptedStanzaSession) and\
|
||||||
|
oldsession.enable_encryption)
|
||||||
|
|
||||||
archiving_changed = bool(session and isinstance(session,
|
archiving_changed = bool(session and isinstance(session,
|
||||||
ArchivingStanzaSession) and session.archiving) != \
|
ArchivingStanzaSession) and session.archiving) != \
|
||||||
bool(oldsession and oldsession.archiving)
|
bool(oldsession and isinstance(oldsession, ArchivingStanzaSession) and\
|
||||||
|
oldsession.archiving)
|
||||||
|
|
||||||
if crypto_changed or archiving_changed:
|
if crypto_changed or archiving_changed:
|
||||||
self.print_session_details()
|
self.print_session_details()
|
||||||
|
|
Loading…
Reference in New Issue