Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gajim-plugins
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
59
Issues
59
List
Boards
Labels
Service Desk
Milestones
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gajim
gajim-plugins
Commits
2df99058
Commit
2df99058
authored
Oct 26, 2020
by
Philipp Hörist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[openpgp] Adapt to nbxmpp changes
parent
ad3da5f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
8 deletions
+15
-8
openpgp/modules/openpgp.py
openpgp/modules/openpgp.py
+15
-8
No files found.
openpgp/modules/openpgp.py
View file @
2df99058
...
...
@@ -21,8 +21,9 @@ from pathlib import Path
from
nbxmpp.namespaces
import
Namespace
from
nbxmpp
import
Node
from
nbxmpp
import
StanzaMalformed
from
nbxmpp.util
import
is_error_result
from
nbxmpp.structs
import
StanzaHandler
from
nbxmpp.errors
import
StanzaError
from
nbxmpp.errors
import
MalformedStanzaError
from
nbxmpp.modules.openpgp
import
PGPKeyMetadata
from
nbxmpp.modules.openpgp
import
parse_signcrypt
from
nbxmpp.modules.openpgp
import
create_signcrypt_node
...
...
@@ -117,10 +118,13 @@ class OpenPGP(BaseModule):
callback
=
self
.
_public_key_received
,
user_data
=
fingerprint
)
def
_public_key_received
(
self
,
result
,
fingerprint
):
if
is_error_result
(
result
):
def
_public_key_received
(
self
,
task
):
fingerprint
=
task
.
get_user_data
()
try
:
result
=
task
.
finish
()
except
(
StanzaError
,
MalformedStanzaError
)
as
error
:
log
.
error
(
'%s => Public Key not found: %s'
,
self
.
_account
,
result
)
self
.
_account
,
error
)
return
imported_key
=
self
.
_pgp
.
import_key
(
result
.
key
,
result
.
jid
)
...
...
@@ -152,16 +156,19 @@ class OpenPGP(BaseModule):
callback
=
self
.
_keylist_received
,
user_data
=
jid
)
def
_keylist_received
(
self
,
result
,
jid
):
if
is_error_result
(
result
):
def
_keylist_received
(
self
,
task
):
jid
=
task
.
get_user_data
()
try
:
keylist
=
task
.
finish
()
except
(
StanzaError
,
MalformedStanzaError
)
as
error
:
log
.
error
(
'%s => Keylist query failed: %s'
,
self
.
_account
,
result
)
self
.
_account
,
error
)
if
self
.
own_jid
.
bareMatch
(
jid
)
and
self
.
_fingerprint
is
not
None
:
self
.
set_keylist
()
return
log
.
info
(
'Keylist received from %s'
,
jid
)
self
.
_process_keylist
(
resul
t
,
jid
)
self
.
_process_keylist
(
keylis
t
,
jid
)
def
_process_keylist
(
self
,
keylist
,
from_jid
):
if
not
keylist
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment