branch: elpa/jabber
commit 5b1194c9ef505f2627645f77622d17bc444bd5e9
Author: Thanos Apollo <[email protected]>
Commit: Thanos Apollo <[email protected]>
omemo-trust: Guard interactive commands without native module
jabber-omemo-show-fingerprints and jabber-omemo-show-trust call
C functions from the native module directly. Add
jabber-omemo--available check to both entry points.
Fixes #114 codeberg
---
lisp/jabber-omemo-trust.el | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lisp/jabber-omemo-trust.el b/lisp/jabber-omemo-trust.el
index 22256c9ba7..6ff01b4fff 100644
--- a/lisp/jabber-omemo-trust.el
+++ b/lisp/jabber-omemo-trust.el
@@ -182,6 +182,8 @@ Returns the key without the first byte, or as-is if shorter
than 2 bytes."
(jabber-jid-user jabber-chatting-with)
(read-string "JID: "))))
(list jc jid)))
+ (unless (bound-and-true-p jabber-omemo--available)
+ (user-error "OMEMO encryption requires the jabber-omemo-core native
module"))
(let* ((account (jabber-connection-bare-jid jc))
(peer (jabber-jid-user jid))
(buf-name (format "*OMEMO trust: %s*" peer)))
@@ -218,6 +220,8 @@ Returns the key without the first byte, or as-is if shorter
than 2 bytes."
"Display own OMEMO fingerprints across all devices for JC.
Fetches the device list and bundles from the server."
(interactive (list (jabber-read-account)))
+ (unless (bound-and-true-p jabber-omemo--available)
+ (user-error "OMEMO encryption requires the jabber-omemo-core native
module"))
(let* ((own-jid (jabber-connection-bare-jid jc))
(buf-name (format "*OMEMO fingerprints: %s*" own-jid))
(our-did (jabber-omemo--get-device-id jc)))