diff options
author | Kim Alvefur <zash@zash.se> | 2017-03-04 17:49:48 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2017-03-04 17:49:48 +0100 |
commit | 1ecc3a7918024a07c2b9f38d274584683e7c3218 (patch) | |
tree | 91aa73ddb7089baef93b2e47966f53c5c945ed52 /core | |
parent | 140c6de0260c404abebb860705a81ed7398c7c52 (diff) | |
download | prosody-1ecc3a7918024a07c2b9f38d274584683e7c3218.tar.gz prosody-1ecc3a7918024a07c2b9f38d274584683e7c3218.zip |
core: Split some very long lines [luacheck]
Diffstat (limited to 'core')
-rw-r--r-- | core/configmanager.lua | 3 | ||||
-rw-r--r-- | core/moduleapi.lua | 6 | ||||
-rw-r--r-- | core/modulemanager.lua | 3 | ||||
-rw-r--r-- | core/portmanager.lua | 12 | ||||
-rw-r--r-- | core/s2smanager.lua | 4 | ||||
-rw-r--r-- | core/sessionmanager.lua | 5 | ||||
-rw-r--r-- | core/stanza_router.lua | 12 | ||||
-rw-r--r-- | core/storagemanager.lua | 6 |
8 files changed, 35 insertions, 16 deletions
diff --git a/core/configmanager.lua b/core/configmanager.lua index 16d4b8e2..5a544375 100644 --- a/core/configmanager.lua +++ b/core/configmanager.lua @@ -158,7 +158,8 @@ do function env.Component(name) name = nameprep(name); - if rawget(config_table, name) and rawget(config_table[name], "defined") and not rawget(config_table[name], "component_module") then + if rawget(config_table, name) and rawget(config_table[name], "defined") + and not rawget(config_table[name], "component_module") then error(format("Component %q clashes with previously defined Host %q, for services use a sub-domain like conference.%s", name, name, name), 0); end diff --git a/core/moduleapi.lua b/core/moduleapi.lua index ee1f3e60..34214f26 100644 --- a/core/moduleapi.lua +++ b/core/moduleapi.lua @@ -115,7 +115,8 @@ function api:hook_tag(xmlns, name, handler, priority) self:log("warn", "Error: Insufficient parameters to module:hook_stanza()"); return; end - return self:hook("stanza/"..(xmlns and (xmlns..":") or "")..name, function (data) return handler(data.origin, data.stanza, data); end, priority); + return self:hook("stanza/"..(xmlns and (xmlns..":") or "")..name, + function (data) return handler(data.origin, data.stanza, data); end, priority); end api.hook_stanza = api.hook_tag; -- COMPAT w/pre-0.9 @@ -187,7 +188,8 @@ function api:shared(...) local path = paths[i]; if path:sub(1,1) ~= "/" then -- Prepend default components local n_components = select(2, path:gsub("/", "%1")); - path = (n_components<#default_path_components and "/" or "")..t_concat(default_path_components, "/", 1, #default_path_components-n_components).."/"..path; + path = (n_components<#default_path_components and "/" or "") + ..t_concat(default_path_components, "/", 1, #default_path_components-n_components).."/"..path; end local shared = shared_data[path]; if not shared then diff --git a/core/modulemanager.lua b/core/modulemanager.lua index 7bed1795..771f6fb1 100644 --- a/core/modulemanager.lua +++ b/core/modulemanager.lua @@ -39,7 +39,8 @@ local _G = _G; local _ENV = nil; -local load_modules_for_host, load, unload, reload, get_module, get_items, get_modules, is_loaded, module_has_method, call_module_method; +local load_modules_for_host, load, unload, reload, get_module, get_items; +local get_modules, is_loaded, module_has_method, call_module_method; -- [host] = { [module] = module_env } local modulemap = { ["*"] = {} }; diff --git a/core/portmanager.lua b/core/portmanager.lua index ad1a0be3..5b6476f3 100644 --- a/core/portmanager.lua +++ b/core/portmanager.lua @@ -103,7 +103,8 @@ local function activate(service_name) if not port_number then log("error", "Invalid port number specified for service '%s': %s", service_info.name, tostring(port)); elseif #active_services:search(nil, interface, port_number) > 0 then - log("error", "Multiple services configured to listen on the same port ([%s]:%d): %s, %s", interface, port, active_services:search(nil, interface, port)[1][1].service.name or "<unnamed>", service_name or "<unnamed>"); + log("error", "Multiple services configured to listen on the same port ([%s]:%d): %s, %s", interface, port, + active_services:search(nil, interface, port)[1][1].service.name or "<unnamed>", service_name or "<unnamed>"); else local err; -- Create SSL context for this service/port @@ -118,14 +119,16 @@ local function activate(service_name) global_ssl_config[interface], global_ssl_config[port]); if not ssl then - log("error", "Error binding encrypted port for %s: %s", service_info.name, error_to_friendly_message(service_name, port_number, err) or "unknown error"); + log("error", "Error binding encrypted port for %s: %s", service_info.name, + error_to_friendly_message(service_name, port_number, err) or "unknown error"); end end if not err then -- Start listening on interface+port local handler, err = server.addserver(interface, port_number, listener, mode, ssl); if not handler then - log("error", "Failed to open server port %d on %s, %s", port_number, interface, error_to_friendly_message(service_name, port_number, err)); + log("error", "Failed to open server port %d on %s, %s", port_number, interface, + error_to_friendly_message(service_name, port_number, err)); else table.insert(hooked_ports, "["..interface.."]:"..port_number); log("debug", "Added listening service %s to [%s]:%d", service_name, interface, port_number); @@ -138,7 +141,8 @@ local function activate(service_name) end end end - log("info", "Activated service '%s' on %s", service_name, #hooked_ports == 0 and "no ports" or table.concat(hooked_ports, ", ")); + log("info", "Activated service '%s' on %s", service_name, + #hooked_ports == 0 and "no ports" or table.concat(hooked_ports, ", ")); return true; end diff --git a/core/s2smanager.lua b/core/s2smanager.lua index a8d399d2..d84572f3 100644 --- a/core/s2smanager.lua +++ b/core/s2smanager.lua @@ -70,7 +70,9 @@ end local function destroy_session(session, reason) if session.destroyed then return; end - (session.log or log)("debug", "Destroying "..tostring(session.direction).." session "..tostring(session.from_host).."->"..tostring(session.to_host)..(reason and (": "..reason) or "")); + (session.log or log)("debug", "Destroying "..tostring(session.direction) + .." session "..tostring(session.from_host).."->"..tostring(session.to_host) + ..(reason and (": "..reason) or "")); if session.direction == "outgoing" then hosts[session.from_host].s2sout[session.to_host] = nil; diff --git a/core/sessionmanager.lua b/core/sessionmanager.lua index 75e54b4f..c5b08098 100644 --- a/core/sessionmanager.lua +++ b/core/sessionmanager.lua @@ -76,7 +76,10 @@ local function retire_session(session) end local function destroy_session(session, err) - (session.log or log)("debug", "Destroying session for %s (%s@%s)%s", session.full_jid or "(unknown)", session.username or "(unknown)", session.host or "(unknown)", err and (": "..err) or ""); + (session.log or log)("debug", "Destroying session for %s (%s@%s)%s", + session.full_jid or "(unknown)", session.username or "(unknown)", + session.host or "(unknown)", err and (": "..err) or ""); + if session.destroyed then return; end -- Remove session/resource from user's session list diff --git a/core/stanza_router.lua b/core/stanza_router.lua index 228fed80..2312614c 100644 --- a/core/stanza_router.lua +++ b/core/stanza_router.lua @@ -38,7 +38,8 @@ local function handle_unhandled_stanza(host, origin, stanza) --luacheck: ignore if st_type == "error" or (name == "iq" and st_type == "result") then if st_type == "error" then local err_type, err_condition, err_message = stanza:get_error(); - log("debug", "Discarding unhandled error %s (%s, %s) from %s: %s", name, err_type, err_condition or "unknown condition", origin_type, stanza:top_tag()); + log("debug", "Discarding unhandled error %s (%s, %s) from %s: %s", + name, err_type, err_condition or "unknown condition", origin_type, stanza:top_tag()); else log("debug", "Discarding %s from %s of type: %s", name, origin_type, st_type or '<nil>'); end @@ -52,7 +53,8 @@ local function handle_unhandled_stanza(host, origin, stanza) --luacheck: ignore origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); end else - log("warn", "Unhandled %s stream element or stanza: %s; xmlns=%s: %s", origin_type, name, xmlns, tostring(stanza)); -- we didn't handle it + log("warn", "Unhandled %s stream element or stanza: %s; xmlns=%s: %s", + origin_type, name, xmlns, tostring(stanza)); -- we didn't handle it origin:close("unsupported-stanza-type"); end end @@ -211,12 +213,14 @@ function core_route_stanza(origin, stanza) else local xmlns = stanza.attr.xmlns; stanza.attr.xmlns = nil; - local routed = host_session.events.fire_event("route/remote", { origin = origin, stanza = stanza, from_host = from_host, to_host = host }); + local routed = host_session.events.fire_event("route/remote", { + origin = origin, stanza = stanza, from_host = from_host, to_host = host }); stanza.attr.xmlns = xmlns; -- reset if not routed then log("debug", "... no, just kidding."); if stanza.attr.type == "error" or (stanza.name == "iq" and stanza.attr.type == "result") then return; end - core_route_stanza(host_session, st.error_reply(stanza, "cancel", "not-allowed", "Communication with remote domains is not enabled")); + core_route_stanza(host_session, st.error_reply(stanza, "cancel", "not-allowed", + "Communication with remote domains is not enabled")); end end end diff --git a/core/storagemanager.lua b/core/storagemanager.lua index 319046b9..75cb8d0f 100644 --- a/core/storagemanager.lua +++ b/core/storagemanager.lua @@ -72,7 +72,8 @@ local function get_storage_config(host) end end if found_sql2 then - log("error", "The temporary 'sql2' storage module has now been renamed to 'sql', please update your config file: https://prosody.im/doc/modules/mod_storage_sql2"); + log("error", "The temporary 'sql2' storage module has now been renamed to 'sql', " + .."please update your config file: https://prosody.im/doc/modules/mod_storage_sql2"); end return storage_config; end @@ -180,7 +181,8 @@ local function purge(user, host) if driver.purge then purged[driver_name] = driver:purge(user); else - log("warn", "Storage driver %s does not support removing all user data, you may need to delete it manually", driver_name); + log("warn", "Storage driver %s does not support removing all user data, " + .."you may need to delete it manually", driver_name); end end end |