[pgp] Don't use deprecated attribute

This commit is contained in:
lovetox
2020-04-30 19:57:38 +02:00
parent e5a43b1c0c
commit e173913145

View File

@@ -168,7 +168,7 @@ class PGPLegacy(BaseModule):
return return
self._cleanup_stanza(event) self._cleanup_stanza(event)
self._create_pgp_legacy_message(event.msg_iq, encrypted_payload) self._create_pgp_legacy_message(event.stanza, encrypted_payload)
event.xhtml = None event.xhtml = None
event.encrypted = 'PGP' event.encrypted = 'PGP'
@@ -253,15 +253,15 @@ class PGPLegacy(BaseModule):
def _cleanup_stanza(obj): def _cleanup_stanza(obj):
''' We make sure only allowed tags are in the stanza ''' ''' We make sure only allowed tags are in the stanza '''
stanza = nbxmpp.Message( stanza = nbxmpp.Message(
to=obj.msg_iq.getTo(), to=obj.stanza.getTo(),
typ=obj.msg_iq.getType()) typ=obj.stanza.getType())
stanza.setID(obj.stanza_id) stanza.setID(obj.stanza_id)
stanza.setThread(obj.msg_iq.getThread()) stanza.setThread(obj.stanza.getThread())
for tag, ns in ALLOWED_TAGS: for tag, ns in ALLOWED_TAGS:
node = obj.msg_iq.getTag(tag, namespace=ns) node = obj.stanza.getTag(tag, namespace=ns)
if node: if node:
stanza.addChild(node=node) stanza.addChild(node=node)
obj.msg_iq = stanza obj.stanza = stanza
def encrypt_file(self, file, callback): def encrypt_file(self, file, callback):
thread = threading.Thread(target=self._encrypt_file_thread, thread = threading.Thread(target=self._encrypt_file_thread,