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
S
slixmpp-omemo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
6
Issues
6
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
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
poezio
slixmpp-omemo
Commits
fe897a78
Verified
Commit
fe897a78
authored
Dec 29, 2019
by
Maxime Buquet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Attempt at having more useful errors for plugin setup
Signed-off-by:
Maxime “pep” Buquet
<
pep@bouah.net
>
parent
6675ab63
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
slixmpp_omemo/__init__.py
slixmpp_omemo/__init__.py
+13
-6
No files found.
slixmpp_omemo/__init__.py
View file @
fe897a78
...
...
@@ -32,14 +32,17 @@ from .stanza import Bundle, Devices, Device, Encrypted, Key, PreKeyPublic
log
=
logging
.
getLogger
(
__name__
)
HAS_OMEMO
=
True
HAS_OMEMO
=
False
HAS_OMEMO_BACKEND
=
False
try
:
import
omemo.exceptions
from
omemo
import
SessionManager
,
ExtendedPublicBundle
,
DefaultOTPKPolicy
from
omemo.util
import
generateDeviceID
from
omemo.implementations
import
JSONFileStorage
from
omemo.backends
import
Backend
HAS_OMEMO
=
True
from
omemo_backend_signal
import
BACKEND
as
SignalBackend
HAS_OMEMO_BACKEND
=
True
except
(
ImportError
,):
class
Backend
:
pass
...
...
@@ -50,8 +53,6 @@ except (ImportError,):
class
SignalBackend
:
pass
HAS_OMEMO
=
False
TRUE_VALUES
=
{
True
,
'true'
,
'1'
}
PUBLISH_OPTIONS_NODE
=
'http://jabber.org/protocol/pubsub#publish-options'
PUBSUB_ERRORS
=
'http://jabber.org/protocol/pubsub#errors'
...
...
@@ -186,15 +187,21 @@ class XEP_0384(BasePlugin):
'omemo_backend'
:
SignalBackend
,
}
backend_loaded
=
HAS_OMEMO
backend_loaded
=
HAS_OMEMO
and
HAS_OMEMO_BACKEND
# OMEMO Bundles used for encryption
bundles
=
{}
# type: Dict[str, Dict[int, ExtendedPublicBundle]]
def
plugin_init
(
self
)
->
None
:
if
not
self
.
backend_loaded
:
log
.
info
(
"xep_0384 cannot be loaded as the backend omemo library "
"is not available"
)
log_str
=
(
"xep_0384 cannot be loaded as the backend omemo library "
"is not available. "
)
if
not
HAS_OMEMO_BACKEND
:
log_str
+=
(
"Make sure you have a python OMEMO backend "
"(python-omemo-backend-signal) installed"
)
else
:
log_str
+=
"Make sure you have the python OMEMO library installed."
log
.
error
(
log_str
)
raise
PluginCouldNotLoad
if
not
self
.
data_dir
:
...
...
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