# HG changeset patch # User Kim Alvefur # Date 1526826067 -7200 # Node ID ec671ad1a8a9bddd8cea8e57b787215d1e68d0db # Parent b19d64dd4c66be09ecf5b267a8959945376aff91 mod_watchuntrusted: Add option for which message 'type' to use on notifications Because poezio treats headline messages in a very sensible way that fits great with this kind of system message diff -r b19d64dd4c66 -r ec671ad1a8a9 mod_watchuntrusted/README.markdown --- a/mod_watchuntrusted/README.markdown Sun May 20 03:43:38 2018 +0200 +++ b/mod_watchuntrusted/README.markdown Sun May 20 16:21:07 2018 +0200 @@ -28,9 +28,10 @@ untrusted_fail_notification = "Establishing a secure connection from $from_host to $to_host failed. Certificate hash: $sha1. $errors" Option Default Description - ------------------------------- --------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------- + ------------------------------- --------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------- untrusted\_fail\_watchers All admins The users to send the message to untrusted\_fail\_notification "Establishing a secure connection from \$from\_host to \$to\_host failed. Certificate hash: \$sha1. \$errors" The message to send, \$from\_host, \$to\_host, \$sha1 and \$errors are replaced + untrusted\_message\_type `"chat"` Which kind of message to send. `"normal"` or `"headline"` are other sensible options Compatibility ============= diff -r b19d64dd4c66 -r ec671ad1a8a9 mod_watchuntrusted/mod_watchuntrusted.lua --- a/mod_watchuntrusted/mod_watchuntrusted.lua Sun May 20 03:43:38 2018 +0200 +++ b/mod_watchuntrusted/mod_watchuntrusted.lua Sun May 20 16:21:07 2018 +0200 @@ -49,7 +49,7 @@ errors = error_message }; - local message = st.message({ type = "chat", from = local_host }, + local message = st.message({ type = msg_type, from = local_host }, untrusted_fail_notification:gsub("%$([%w_]+)", function (v) return event[v] or session and session[v] or replacements and replacements[v] or nil; end));