Mercurial > prosody-modules
comparison mod_watchuntrusted/mod_watchuntrusted.lua @ 6462:021eff79a1f5
mod_watchuntrusted/mod_watchuntrusted.lua: making luacheck happy
| author | Menel <menel@snikket.de> |
|---|---|
| date | Fri, 13 Mar 2026 12:43:05 +0100 |
| parents | 0e78523f8c20 |
| children |
comparison
equal
deleted
inserted
replaced
| 6461:2cf397983c16 | 6462:021eff79a1f5 |
|---|---|
| 5 module:get_option_set("s2s_secure_domains", {})._items, module:get_option_set("s2s_insecure_domains", {})._items; | 5 module:get_option_set("s2s_secure_domains", {})._items, module:get_option_set("s2s_insecure_domains", {})._items; |
| 6 | 6 |
| 7 local ignore_domains = module:get_option_set("untrusted_ignore_domains", {})._items; | 7 local ignore_domains = module:get_option_set("untrusted_ignore_domains", {})._items; |
| 8 | 8 |
| 9 local untrusted_fail_watchers = module:get_option_set("untrusted_fail_watchers", module:get_option("admins", {})) / jid_prep; | 9 local untrusted_fail_watchers = module:get_option_set("untrusted_fail_watchers", module:get_option("admins", {})) / jid_prep; |
| 10 local untrusted_fail_notification = module:get_option("untrusted_fail_notification", "Establishing a secure connection from $from_host to $to_host failed. Certificate hash: $sha256. $errors"); | 10 local untrusted_fail_notification = module:get_option( |
| 11 "untrusted_fail_notification", | |
| 12 "Establishing a secure connection from $from_host to $to_host failed. Certificate hash: $sha256. $errors" | |
| 13 ); | |
| 11 | 14 |
| 12 local msg_type = module:get_option_string("untrusted_message_type", "chat"); | 15 local msg_type = module:get_option_string("untrusted_message_type", "chat"); |
| 13 | 16 |
| 14 local st = require "util.stanza"; | 17 local st = require "util.stanza"; |
| 15 | 18 |
| 19 local session, host = event.session, event.host; | 22 local session, host = event.session, event.host; |
| 20 if not host then return end | 23 if not host then return end |
| 21 local conn = session.conn:socket(); | 24 local conn = session.conn:socket(); |
| 22 local local_host = session.direction == "outgoing" and session.from_host or session.to_host; | 25 local local_host = session.direction == "outgoing" and session.from_host or session.to_host; |
| 23 | 26 |
| 24 if not (local_host == module:get_host()) then return end | 27 if (local_host ~= module:get_host()) then return end |
| 25 | 28 |
| 26 module:log("debug", "Checking certificate..."); | 29 module:log("debug", "Checking certificate..."); |
| 27 local certificate_is_valid = false; | 30 local certificate_is_valid = false; |
| 28 | 31 |
| 29 if session.cert_chain_status == "valid" and session.cert_identity_status == "valid" then | 32 if session.cert_chain_status == "valid" and session.cert_identity_status == "valid" then |
