equal
deleted
inserted
replaced
10 local e2e_policy_message_optional_muc = module:get_option_string("e2e_policy_message_optional_muc", "For security reasons, OMEMO, OTR or PGP encryption is STRONGLY recommended for MUC on this server."); |
10 local e2e_policy_message_optional_muc = module:get_option_string("e2e_policy_message_optional_muc", "For security reasons, OMEMO, OTR or PGP encryption is STRONGLY recommended for MUC on this server."); |
11 local e2e_policy_message_required_muc = module:get_option_string("e2e_policy_message_required_muc", "For security reasons, OMEMO, OTR or PGP encryption is required for MUC on this server."); |
11 local e2e_policy_message_required_muc = module:get_option_string("e2e_policy_message_required_muc", "For security reasons, OMEMO, OTR or PGP encryption is required for MUC on this server."); |
12 |
12 |
13 function warn_on_plaintext_messages(event) |
13 function warn_on_plaintext_messages(event) |
14 -- check if JID is whitelisted |
14 -- check if JID is whitelisted |
15 if e2e_policy_whitelist:contains(jid_bare(stanza.attr.from)) or e2e_policy_whitelist:contains(jid_bare(stanza.attr.to)) then |
15 if e2e_policy_whitelist:contains(jid_bare(event.stanza.attr.from)) or e2e_policy_whitelist:contains(jid_bare(event.stanza.attr.to)) then |
16 return nil; |
16 return nil; |
17 end |
17 end |
18 local body = event.stanza:get_child_text("body"); |
18 local body = event.stanza:get_child_text("body"); |
19 -- do not warn for status messages |
19 -- do not warn for status messages |
20 if not body or event.stanza.attr.type == "error" then |
20 if not body or event.stanza.attr.type == "error" then |