# HG changeset patch # User Kim Alvefur # Date 1475334903 -7200 # Node ID 3e5828e3f17f4ff72310dbe1295a3dd91a7159e3 # Parent 465b34fdeb60f6395ee830827c50305bbf185977 mod_server_contact_info: Log error when no addresses or admins are set diff -r 465b34fdeb60 -r 3e5828e3f17f mod_server_contact_info/mod_server_contact_info.lua --- a/mod_server_contact_info/mod_server_contact_info.lua Sat Oct 01 17:13:57 2016 +0200 +++ b/mod_server_contact_info/mod_server_contact_info.lua Sat Oct 01 17:15:03 2016 +0200 @@ -14,10 +14,10 @@ } local contact_config = module:get_option("contact_info"); -if not contact_config then -- we'll use admins from the config as default +if not contact_config or not next(contact_config) then -- we'll use admins from the config as default local admins = module:get_option_inherited_set("admins", {}); if admins:empty() then - module:log("debug", "No contact_info or admins in config"); + module:log("error", "No contact_info or admins set in config"); return -- Nothing to attach, so we'll just skip it. end module:log("debug", "No contact_info in config, using admins as fallback"); @@ -25,10 +25,7 @@ admin = array.collect( admins / function(admin) return "xmpp:" .. admin; end); }; end -if not next(contact_config) then - module:log("debug", "No contacts, skipping"); - return -- No use in serving an empty form. -end + local form_layout = { { value = "http://jabber.org/network/serverinfo"; type = "hidden"; name = "FORM_TYPE"; }; };