mirror of
https://github.com/moparisthebest/prosody-otr
synced 2025-03-11 07:00:23 -04:00
Add support for OMEMO and PGP encryption
This commit is contained in:
parent
d5e3b61758
commit
aca3b89983
18
mod_otr.lua
18
mod_otr.lua
@ -26,11 +26,11 @@ local st = require "util.stanza";
|
||||
local policy = module:get_option_string("otr_policy", "optional");
|
||||
|
||||
local mandatory;
|
||||
local mandatory_msg = "For security reasons, OTR encryption is required for conversations on this server";
|
||||
local mandatory_msg = "For security reasons, OTR, OMEMO, or PGP encryption is required for conversations on this server";
|
||||
local optional;
|
||||
local optional_msg = "For security reasons, OTR encryption is STRONGLY recommended for conversations on this server";
|
||||
local optional_msg = "For security reasons, OTR, OMEMO, or PGP encryption is STRONGLY recommended for conversations on this server";
|
||||
local mixed;
|
||||
local muc_msg = "Beware, Multi-User Chat is not supported by OTR."
|
||||
local muc_msg = "Beware, Multi-User Chat is not supported by OTR, but is supported by OMEMO or PGP in specific circumstances with some clients."
|
||||
|
||||
local messaged = {};
|
||||
|
||||
@ -70,6 +70,18 @@ local function check_message_otr(event)
|
||||
return nil;
|
||||
end
|
||||
|
||||
-- check omemo https://xmpp.org/extensions/inbox/omemo.html
|
||||
if event.stanza:get_child("encrypted", "eu.siacs.conversations.axolotl") or event.stanza:get_child("encrypted", "urn:xmpp:omemo:0") then
|
||||
return nil;
|
||||
end
|
||||
|
||||
-- check xep27 pgp https://xmpp.org/extensions/xep-0027.html
|
||||
if event.stanza:get_child("x", "jabber:x:encrypted") then
|
||||
return nil;
|
||||
end
|
||||
|
||||
-- no valid encryption found
|
||||
|
||||
-- Warn the user that OTR will not work on MUC but let the message pass.
|
||||
-- Available for optional and mixed mode.
|
||||
if stanza.attr.type == "groupchat" and not mandatory then
|
||||
|
Loading…
x
Reference in New Issue
Block a user