# HG changeset patch # User Florian Zeitz # Date 1394559841 -3600 # Node ID 7dbde05b48a907c944c3bfd7a35cdbf2abebbe70 # Parent 0ae065453dc90156b51d1b01f37a642dae3b03e5 all the things: Remove trailing whitespace diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_admin_web/admin_web/mod_admin_web.lua --- a/mod_admin_web/admin_web/mod_admin_web.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_admin_web/admin_web/mod_admin_web.lua Tue Mar 11 18:44:01 2014 +0100 @@ -205,14 +205,14 @@ service[module.host]:set_affiliation(xmlns_s2s_session, true, module.host, "owner") end - -- Add outgoing s2s sessions + -- Add outgoing s2s sessions for remotehost, session in pairs(hosts[module.host].s2sout) do if session.type ~= "s2sout_unauthed" then add_host(session, "out", module.host); end end - -- Add incomming s2s sessions + -- Add incomming s2s sessions for session in pairs(incoming_s2s) do if session.to_host == module.host then add_host(session, "in", module.host); diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_auth_any/mod_auth_any.lua --- a/mod_auth_any/mod_auth_any.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_auth_any/mod_auth_any.lua Tue Mar 11 18:44:01 2014 +0100 @@ -45,7 +45,7 @@ function provider.create_user(username, password) return datamanager.store(username, host, "accounts", {password = password}); end - + function provider.delete_user(username) return datamanager.store(username, host, "accounts", nil); end @@ -58,7 +58,7 @@ }; return new_sasl(module.host, getpass_authentication_profile); end - + return provider; end diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_auth_custom_http/mod_auth_custom_http.lua --- a/mod_auth_custom_http/mod_auth_custom_http.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_auth_custom_http/mod_auth_custom_http.lua Tue Mar 11 18:44:01 2014 +0100 @@ -49,7 +49,7 @@ }; return new_sasl(module.host, getpass_authentication_profile); end - + module:provides("auth", provider); diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_auth_dovecot/auth_dovecot/sasl_dovecot.lib.lua --- a/mod_auth_dovecot/auth_dovecot/sasl_dovecot.lib.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_auth_dovecot/auth_dovecot/sasl_dovecot.lib.lua Tue Mar 11 18:44:01 2014 +0100 @@ -256,7 +256,7 @@ else self.username = nodeprep(data.user); end - if not self.username then + if not self.username then return "failure", "not-authorized", "Username failed NODEprep" end end @@ -272,7 +272,7 @@ elseif resp == "CONT" then return "challenge", unb64(data[1]); elseif resp == "OK" then - return "success", data.resp and unb64(data.resp) or nil; + return "success", data.resp and unb64(data.resp) or nil; end end diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_auth_external/mod_auth_external.lua --- a/mod_auth_external/mod_auth_external.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_auth_external/mod_auth_external.lua Tue Mar 11 18:44:01 2014 +0100 @@ -85,11 +85,11 @@ function do_query(kind, username, password) if not username then return nil, "not-acceptable"; end - + local query = (password and "%s:%s:%s:%s" or "%s:%s:%s"):format(kind, username, host, password); local len = #query if len > 1000 then return nil, "policy-violation"; end - + if script_type == "ejabberd" then local lo = len % 256; local hi = (len - lo) / 256; @@ -97,7 +97,7 @@ elseif script_type == "generic" then query = query..'\n'; end - + local response, err = send_query(query); if not response then log("warn", "Error while waiting for result from auth process: %s", err or "unknown error"); diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_auth_imap/auth_imap/sasl_imap.lib.lua --- a/mod_auth_imap/auth_imap/sasl_imap.lib.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_auth_imap/auth_imap/sasl_imap.lib.lua Tue Mar 11 18:44:01 2014 +0100 @@ -103,7 +103,7 @@ local mech = cap:match("AUTH=(.*)"); if mech then log("debug", "Supported SASL mechanism: %s", mech); - supported_mechs[mech] = mitm[mech] and true or nil; + supported_mechs[mech] = mitm[mech] and true or nil; end end end diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_auth_internal_yubikey/mod_auth_internal_yubikey.lua --- a/mod_auth_internal_yubikey/mod_auth_internal_yubikey.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_auth_internal_yubikey/mod_auth_internal_yubikey.lua Tue Mar 11 18:44:01 2014 +0100 @@ -110,7 +110,7 @@ }; return new_sasl(realm, getpass_authentication_profile); end - + module:provides("auth", provider); function module.command(arg) @@ -122,15 +122,15 @@ prosodyctl.show_usage([[mod_auth_internal_yubikey associate JID]], [[Set the Yubikey details for a user]]); return 1; end - + local username, host = jid.prepped_split(user_jid); if not username or not host then print("Invalid JID: "..user_jid); return 1; end - + local password, public_id, private_id, key; - + for i=2,#arg do local k, v = arg[i]:match("^%-%-(%w+)=(.*)$"); if not k then @@ -146,7 +146,7 @@ key = v; end end - + if not password then print(":: Password ::"); print("This is an optional password that should be always"); @@ -160,8 +160,8 @@ return 1; end end - - if not public_id then + + if not public_id then print(":: Public Yubikey ID ::"); print("This is a fixed string of characters between 0 and 16"); print("bytes long that the Yubikey prefixes to every token."); @@ -181,7 +181,7 @@ end end end - + if not private_id then print(":: Private Yubikey ID ::"); print("This is a fixed secret UID programmed into the yubikey"); @@ -200,8 +200,8 @@ break; end end - end - + end + if not key then print(":: AES Encryption Key ::"); print("This is the secret key that the Yubikey uses to encrypt the"); @@ -219,7 +219,7 @@ end end end - + local hash = hashes.sha1(public_id..private_id..password, true); local account = { yubikey_hash = hash; diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_auth_joomla/mod_auth_joomla.lua --- a/mod_auth_joomla/mod_auth_joomla.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_auth_joomla/mod_auth_joomla.lua Tue Mar 11 18:44:01 2014 +0100 @@ -47,13 +47,13 @@ do -- process options to get a db connection params = params or { driver = "SQLite3" }; - + if params.driver == "SQLite3" then params.database = resolve_relative_path(prosody.paths.data or ".", params.database or "prosody.sqlite"); end - + assert(params.driver and params.database, "Both the SQL driver and the database need to be specified"); - + assert(connect()); end @@ -70,7 +70,7 @@ local ok, err = stmt:execute(...); if not ok and not test_connection() then error("connection failed"); end if not ok then return nil, err; end - + return stmt; end local function setsql(sql, ...) diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_auth_phpbb3/mod_auth_phpbb3.lua --- a/mod_auth_phpbb3/mod_auth_phpbb3.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_auth_phpbb3/mod_auth_phpbb3.lua Tue Mar 11 18:44:01 2014 +0100 @@ -47,13 +47,13 @@ do -- process options to get a db connection params = params or { driver = "SQLite3" }; - + if params.driver == "SQLite3" then params.database = resolve_relative_path(prosody.paths.data or ".", params.database or "prosody.sqlite"); end - + assert(params.driver and params.database, "Both the SQL driver and the database need to be specified"); - + assert(connect()); end @@ -70,7 +70,7 @@ local ok, err = stmt:execute(...); if not ok and not test_connection() then error("connection failed"); end if not ok then return nil, err; end - + return stmt; end local function setsql(sql, ...) diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_auth_sql/mod_auth_sql.lua --- a/mod_auth_sql/mod_auth_sql.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_auth_sql/mod_auth_sql.lua Tue Mar 11 18:44:01 2014 +0100 @@ -43,13 +43,13 @@ do -- process options to get a db connection params = params or { driver = "SQLite3" }; - + if params.driver == "SQLite3" then params.database = resolve_relative_path(prosody.paths.data or ".", params.database or "prosody.sqlite"); end - + assert(params.driver and params.database, "Both the SQL driver and the database need to be specified"); - + assert(connect()); end @@ -66,7 +66,7 @@ local ok, err = stmt:execute(...); if not ok and not test_connection() then error("connection failed"); end if not ok then return nil, err; end - + return stmt; end diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_auth_wordpress/mod_auth_wordpress.lua --- a/mod_auth_wordpress/mod_auth_wordpress.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_auth_wordpress/mod_auth_wordpress.lua Tue Mar 11 18:44:01 2014 +0100 @@ -49,13 +49,13 @@ do -- process options to get a db connection params = params or { driver = "SQLite3" }; - + if params.driver == "SQLite3" then params.database = resolve_relative_path(prosody.paths.data or ".", params.database or "prosody.sqlite"); end - + assert(params.driver and params.database, "Both the SQL driver and the database need to be specified"); - + assert(connect()); end @@ -72,7 +72,7 @@ local ok, err = stmt:execute(...); if not ok and not test_connection() then error("connection failed"); end if not ok then return nil, err; end - + return stmt; end local function setsql(sql, ...) diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_auto_accept_subscriptions/mod_auto_accept_subscriptions.lua --- a/mod_auto_accept_subscriptions/mod_auto_accept_subscriptions.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_auto_accept_subscriptions/mod_auto_accept_subscriptions.lua Tue Mar 11 18:44:01 2014 +0100 @@ -34,7 +34,7 @@ return true; end end - end + end module:log("warn", "Failed to auto-accept subscription request from %s to %s", from_bare, to_bare); end diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_auto_activate_hosts/mod_auto_activate_hosts.lua --- a/mod_auto_activate_hosts/mod_auto_activate_hosts.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_auto_activate_hosts/mod_auto_activate_hosts.lua Tue Mar 11 18:44:01 2014 +0100 @@ -19,13 +19,13 @@ local enabled_hosts = set.new(array.collect(it.keys(new_config)):filter(host_is_enabled):filter(host_not_global)); local need_to_activate = enabled_hosts - active_hosts; local need_to_deactivate = active_hosts - enabled_hosts; - + module:log("debug", "Config reloaded... %d hosts need activating, and %d hosts need deactivating", it.count(need_to_activate), it.count(need_to_deactivate)); - module:log("debug", "There are %d enabled and %d active hosts", it.count(enabled_hosts), it.count(active_hosts)); + module:log("debug", "There are %d enabled and %d active hosts", it.count(enabled_hosts), it.count(active_hosts)); for host in need_to_deactivate do hostmanager.deactivate(host); end - + -- If the lazy loader is loaded, hosts will get activated when they are needed if not(getmetatable(prosody.hosts) and getmetatable(prosody.hosts).lazy_loader) then for host in need_to_activate do diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_c2s_conn_throttle/mod_c2s_conn_throttle.lua --- a/mod_c2s_conn_throttle/mod_c2s_conn_throttle.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_c2s_conn_throttle/mod_c2s_conn_throttle.lua Tue Mar 11 18:44:01 2014 +0100 @@ -13,7 +13,7 @@ in_count[session.ip] = { t = time(), c = 1 } elseif in_count[session.ip] and session.type == "c2s_unauthed" then if in_count[session.ip].starttls_c then in_count[session.ip].c = in_count[session.ip].starttls_c else in_count[session.ip].c = in_count[session.ip].c + 1 end - + if in_count[session.ip].c > logins_count and time() - in_count[session.ip].t < throttle_time then module:log("error", "Exceeded login count for %s, closing connection", session.ip) session:close{ condition = "policy-violation", text = "You exceeded the number of connections/logins allowed in "..throttle_time.." seconds, good bye." } @@ -21,7 +21,7 @@ elseif time() - in_count[session.ip].t > throttle_time then in_count[session.ip] = nil ; return end - end + end end local function check_starttls(event) diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_carbons/mod_carbons.lua --- a/mod_carbons/mod_carbons.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_carbons/mod_carbons.lua Tue Mar 11 18:44:01 2014 +0100 @@ -31,7 +31,7 @@ local orig_type = stanza.attr.type; local orig_from = stanza.attr.from; local orig_to = stanza.attr.to; - + if not (orig_type == nil or orig_type == "normal" or orig_type == "chat") then diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_carbons_adhoc/mod_carbons_adhoc.lua --- a/mod_carbons_adhoc/mod_carbons_adhoc.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_carbons_adhoc/mod_carbons_adhoc.lua Tue Mar 11 18:44:01 2014 +0100 @@ -1,4 +1,4 @@ --- Implement a Adhoc command which will show a user +-- Implement a Adhoc command which will show a user -- the status of carbons generation in regard to his clients -- -- Copyright (C) 2012 Michael Holzt @@ -21,7 +21,7 @@ local user_sessions = bare_sessions[bare_jid]; local result = ""; - + user_sessions = user_sessions and user_sessions.sessions; for _, session in pairs(user_sessions) do if session.full_jid then @@ -36,7 +36,7 @@ return { info = result, status = "completed" }; end -local status_desc = adhoc_new("Carbons: Get Status", +local status_desc = adhoc_new("Carbons: Get Status", "mod_carbons_adhoc#status", adhoc_status); module:add_item("adhoc", status_desc); diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_carbons_copies/mod_carbons_copies.lua --- a/mod_carbons_copies/mod_carbons_copies.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_carbons_copies/mod_carbons_copies.lua Tue Mar 11 18:44:01 2014 +0100 @@ -17,15 +17,15 @@ local jid_split = require "util.jid".split; local dm_load = require "util.datamanager".load; -local dm_store = require "util.datamanager".store; +local dm_store = require "util.datamanager".store; local adhoc_new = module:require "adhoc".new; local xmlns_carbons_v0 = "urn:xmpp:carbons:0"; local storename = "mod_carbons_copies"; local function toggle_copies(data, on) - local username, hostname, resource = jid_split(data.from); + local username, hostname, resource = jid_split(data.from); dm_store(username, hostname, storename, { enabled = on }); -end +end local function adhoc_enable_copies(self, data, state) toggle_copies(data, true); @@ -40,24 +40,24 @@ module:hook("resource-bind", function(event) local session = event.session; local username, hostname, resource = jid_split(session.full_jid); - - local store = dm_load(username, hostname, storename) or - { enabled = + + local store = dm_load(username, hostname, storename) or + { enabled = module:get_option_boolean("carbons_copies_default") }; - + if store.enabled then session.want_carbons = xmlns_carbons_v0; module:log("debug", "%s enabling copies", session.full_jid); end end); - + -- Adhoc-Support if module:get_option_boolean("carbons_copies_adhoc") then local enable_desc = adhoc_new("Carbons: Enable Copies", "mod_carbons_copies#enable", adhoc_enable_copies); local disable_desc = adhoc_new("Carbons: Disable Copies", "mod_carbons_copies#disable", adhoc_disable_copies); - + module:add_item("adhoc", enable_desc); module:add_item("adhoc", disable_desc); end diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_client_certs/mod_client_certs.lua --- a/mod_client_certs/mod_client_certs.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_client_certs/mod_client_certs.lua Tue Mar 11 18:44:01 2014 +0100 @@ -140,7 +140,7 @@ origin.send(st.error_reply(stanza, "cancel", "bad-request", "Missing fields.")); -- cancel? not modify? return true end - + local can_manage = append:get_child("no-cert-management", xmlns_saslcert) ~= nil; x509cert = x509cert:gsub("^%s*(.-)%s*$", "%1"); diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_component_client/mod_component_client.lua --- a/mod_component_client/mod_component_client.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_component_client/mod_component_client.lua Tue Mar 11 18:44:01 2014 +0100 @@ -169,19 +169,19 @@ local conn_name = "jcp"..tostring(session):match("[a-f0-9]+$"); session.log = logger.init(conn_name); session.close = session_close; - + session.log("info", "Outgoing Jabber component connection"); - + local stream = new_xmpp_stream(session, stream_callbacks); session.stream = stream; - + function session.data(conn, data) local ok, err = stream:feed(data); if ok then return; end module:log("debug", "Received invalid XML (%s) %d bytes: %s", tostring(err), #data, data:sub(1, 300):gsub("[\r\n]+", " "):gsub("[%z\1-\31]", "_")); session:close("not-well-formed"); end - + session.dispatch_stanza = stream_callbacks.handlestanza; session.notopen = true; diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_component_roundrobin/mod_component_roundrobin.lua --- a/mod_component_roundrobin/mod_component_roundrobin.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_component_roundrobin/mod_component_roundrobin.lua Tue Mar 11 18:44:01 2014 +0100 @@ -1,7 +1,7 @@ -- Prosody IM -- Copyright (C) 2008-2010 Matthew Wild -- Copyright (C) 2008-2010 Waqas Hussain --- +-- -- This project is MIT/X11 licensed. Please see the -- COPYING file in the source package for more information. -- @@ -58,7 +58,7 @@ --- Handle authentication attempts by components function handle_component_auth(event) local session, stanza = event.origin, event.stanza; - + if session.type ~= "component_unauthed" then return; end if sessions[session] then return; end @@ -67,14 +67,14 @@ session:close("not-authorized"); return true; end - + local secret = module:get_option("component_secret"); if not secret then (session.log or log)("warn", "Component attempted to identify as %s, but component_secret is not set", session.host); session:close("not-authorized"); return true; end - + local supplied_token = t_concat(stanza); local calculated_token = sha1(session.streamid..secret, true); if supplied_token:lower() ~= calculated_token:lower() then @@ -82,7 +82,7 @@ session:close{ condition = "not-authorized", text = "Given token does not match calculated token" }; return true; end - + -- Add session to sessions table sessions[session] = true; session.on_destroy = on_destroy; @@ -90,7 +90,7 @@ session.type = "component"; log("info", "Component successfully authenticated: %s", session.host); session.send(st.stanza("handshake")); - + return true; end diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_conformance_restricted/mod_conformance_restricted.lua --- a/mod_conformance_restricted/mod_conformance_restricted.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_conformance_restricted/mod_conformance_restricted.lua Tue Mar 11 18:44:01 2014 +0100 @@ -1,6 +1,6 @@ -- Prosody IM -- Copyright (C) 2012 Florian Zeitz --- +-- -- This project is MIT/X11 licensed. Please see the -- COPYING file in the source package for more information. -- @@ -12,7 +12,7 @@ local origin, stanza = event.origin, event.stanza; local node, host, resource = jid.split(stanza.attr.to); local body = stanza:get_child_text("body"); - + if resource ~= "conformance" then return; -- Not interop testing end @@ -30,6 +30,6 @@ reply:body("Send me one of: PI, comment, DTD, or entity"); origin.send(reply); end - + return true; end); diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_data_access/mod_data_access.lua --- a/mod_data_access/mod_data_access.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_data_access/mod_data_access.lua Tue Mar 11 18:44:01 2014 +0100 @@ -78,7 +78,7 @@ end local p_host, p_user, p_store, p_type = unpack(path_items); - + if not p_store or not p_store:match("^[%a_]+$") then return 404; end @@ -99,7 +99,7 @@ --TODO Use the Accept header local content_type = p_type or "json"; - if data and encoders[content_type] then + if data and encoders[content_type] then response.headers.content_type = content_type_map[content_type].."; charset=utf-8"; return encoders[content_type](data); else diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_default_bookmarks/mod_default_bookmarks.lua --- a/mod_default_bookmarks/mod_default_bookmarks.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_default_bookmarks/mod_default_bookmarks.lua Tue Mar 11 18:44:01 2014 +0100 @@ -2,7 +2,7 @@ -- Copyright (C) 2008-2010 Matthew Wild -- Copyright (C) 2008-2010 Waqas Hussain -- Copyright (C) 2011 Kim Alvefur --- +-- -- This project is MIT/X11 licensed. Please see the -- COPYING file in the source package for more information. -- diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_email_pass/mod_email_pass.lua --- a/mod_email_pass/mod_email_pass.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_email_pass/mod_email_pass.lua Tue Mar 11 18:44:01 2014 +0100 @@ -26,7 +26,7 @@ tokens_mails = {}; tokens_expiration = {}; --- URL +-- URL local https_host = module:get_option_string("https_host"); local http_host = module:get_option_string("http_host"); local https_port = module:get_option("https_ports", { 443 }); @@ -162,7 +162,7 @@ end end -function isExpired(token) +function isExpired(token) if not tokens_expiration[token] then return nil; end @@ -172,10 +172,10 @@ else -- token invalid, we can create a fresh one. return true; - end + end end --- Expire tokens +-- Expire tokens expireTokens = function() for token,value in pairs(tokens_mails) do if isExpired(token) then @@ -199,21 +199,21 @@ function generateUrl(token) local url; - + if https_host then url = "https://" .. https_host; else url = "http://" .. http_host; end - + if https_port then url = url .. ":" .. https_port[1]; else url = url .. ":" .. http_port[1]; end - + url = url .. url_path .. "token.html?" .. token; - + return url; end @@ -229,7 +229,7 @@ local prepped_username = nodeprep(user); local prepped_mail = form.email; local jid = prepped_username .. "@" .. host; - + if not prepped_username then return nil, "El usuario contiene caracteres incorrectos"; end @@ -239,13 +239,13 @@ if not usermanager.user_exists(prepped_username, module.host) then return nil, "El usuario NO existe"; end - + if #prepped_mail == 0 then return nil, "El campo email está vacio"; end local vcarduser = get_user_vcard(prepped_username, module.host); - + if not vcarduser then return nil, "User has not vCard"; else @@ -258,17 +258,17 @@ if email ~= string.lower(prepped_mail) then return nil, "Dirección eMail incorrecta"; end - + -- Check if has already a valid token, not used yet. if hasTokenActive(jid) then local valid_until = tokens_expiration[hasTokenActive(jid)] + 86400; return nil, "Ya tienes una petición de restablecimiento de clave válida hasta: " .. datetime.date(valid_until) .. " " .. datetime.time(valid_until); end - + local url_token = generateToken(jid); local url = generateUrl(url_token); local email_body = render(get_template("sendtoken",".mail"), {jid = jid, url = url} ); - + module:log("info", "Sending password reset mail to user %s", jid); send_email(email, smtp_address, email_body, mail_subject); return "ok"; @@ -279,7 +279,7 @@ function reset_password_with_token(form, origin) local token = form.token; local password = form.newpassword; - + if not token then return nil, "El Token es inválido"; end @@ -294,7 +294,7 @@ end local jid = tokens_mails[token]; local user, host, resource = jidutil.split(jid); - + usermanager.set_password(user, password, host); module:log("info", "Password changed with token for user %s", jid); tokens_mails[token] = nil; diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_email_pass/templates/changepass.html --- a/mod_email_pass/templates/changepass.html Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_email_pass/templates/changepass.html Tue Mar 11 18:44:01 2014 +0100 @@ -2,35 +2,35 @@ - + Reseteo de la clave de tu cuenta Jabber

Reseteo de la clave de tu cuenta Jabber

-

{notice}

- - @{hostname} -
- - +

{notice}

+ + @{hostname}
- + + +
+

Al pulsar sobre el botón, se enviará a la dirección de correo que figura - en tu vCard un enlace en el que deberás entrar.
+ en tu vCard un enlace en el que deberás entrar.

-
+ diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_email_pass/templates/resetok.html --- a/mod_email_pass/templates/resetok.html Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_email_pass/templates/resetok.html Tue Mar 11 18:44:01 2014 +0100 @@ -2,7 +2,7 @@ - + Clave reseteada! diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_email_pass/templates/sendmailok.html --- a/mod_email_pass/templates/sendmailok.html Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_email_pass/templates/sendmailok.html Tue Mar 11 18:44:01 2014 +0100 @@ -2,7 +2,7 @@ - + Enlace enviado! diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_email_pass/templates/token.html --- a/mod_email_pass/templates/token.html Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_email_pass/templates/token.html Tue Mar 11 18:44:01 2014 +0100 @@ -1,7 +1,7 @@ - + Reseto de la clave de tu cuenta Jabber @@ -9,19 +9,19 @@

Reseteo de la clave de tu cuenta Jabber

-

{notice}

+

{notice}

- +
- +
diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_firewall/actions.lib.lua --- a/mod_firewall/actions.lib.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_firewall/actions.lib.lua Tue Mar 11 18:44:01 2014 +0100 @@ -126,7 +126,7 @@ return ([[local newstanza = st.%s; %s;%s]]) :format(make_new, reroute, drop and " return true;" or ""), deps; end - + function action_handlers.BOUNCE(with) local error = with and with:match("^%S+") or "service-unavailable"; local error_type = error:match(":(%S+)"); diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_firewall/mod_firewall.lua --- a/mod_firewall/mod_firewall.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_firewall/mod_firewall.lua Tue Mar 11 18:44:01 2014 +0100 @@ -138,23 +138,23 @@ local function compile_firewall_rules(filename) local line_no = 0; - + local function errmsg(err) return "Error compiling "..filename.." on line "..line_no..": "..err; end - + local ruleset = { deliver = {}; }; local chain = "deliver"; -- Default chain local rule; - + local file, err = io.open(filename); if not file then return nil, err; end - + local state; -- nil -> "rules" -> "actions" -> nil -> ... - + local line_hold; for line in file:lines() do line = line:match("^%s*(.-)%s*$"); @@ -165,7 +165,7 @@ line_hold = (line_hold or "")..line:sub(1,-2); end line_no = line_no + 1; - + if line_hold or line:match("^[#;]") then -- No action; comment or partial line elseif line == "" then @@ -268,9 +268,9 @@ end end end - + -- Compile ruleset and return complete code - + local chain_handlers = {}; -- Loop through the chains in the parsed ruleset (e.g. incoming, outgoing) @@ -338,7 +338,7 @@ chain_handlers[chain_name] = code_string; end - + return chain_handlers; end @@ -362,7 +362,7 @@ for script in firewall_scripts do script = resolve_relative_path(prosody.paths.config, script); local chain_functions, err = compile_firewall_rules(script) - + if not chain_functions then module:log("error", "Error compiling %s: %s", script, err or "unknown error"); else diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_flash_policy/mod_flash_policy.lua --- a/mod_flash_policy/mod_flash_policy.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_flash_policy/mod_flash_policy.lua Tue Mar 11 18:44:01 2014 +0100 @@ -23,7 +23,7 @@ else return data; -- Pass data through, it wasn't a policy request end - + end function filter_session(session) diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_group_bookmarks/mod_group_bookmarks.lua --- a/mod_group_bookmarks/mod_group_bookmarks.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_group_bookmarks/mod_group_bookmarks.lua Tue Mar 11 18:44:01 2014 +0100 @@ -1,7 +1,7 @@ -- Prosody IM -- Copyright (C) 2008-2010 Matthew Wild -- Copyright (C) 2008-2010 Waqas Hussain --- +-- -- This project is MIT/X11 licensed. Please see the -- COPYING file in the source package for more information. -- @@ -84,7 +84,7 @@ module:log("error", "Please specify group_bookmarks_file in your configuration"); return; end - + local curr_room; for line in io.lines(bookmarks_file) do if line:match("^%s*%[.-%]%s*$") then diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_host_guard/mod_host_guard.lua --- a/mod_host_guard/mod_host_guard.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_host_guard/mod_host_guard.lua Tue Mar 11 18:44:01 2014 +0100 @@ -50,7 +50,7 @@ hosts[host].events.add_handler("s2sin-established", s2s_hook, 500) hosts[host].events.add_handler("route/remote", rr_hook, 500) hosts[host].events.add_handler("stanza/jabber:server:dialback:result", s2s_hook, 500) - if not u then + if not u then module:log ("debug", "adding host protection for: "..host) else module:log ("debug", "updating or adding host protection for: "..host) diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_http_dir_listing/http_dir_listing/mod_http_dir_listing.lua --- a/mod_http_dir_listing/http_dir_listing/mod_http_dir_listing.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_http_dir_listing/http_dir_listing/mod_http_dir_listing.lua Tue Mar 11 18:44:01 2014 +0100 @@ -1,6 +1,6 @@ -- Prosody IM -- Copyright (C) 2012 Kim Alvefur --- +-- -- This project is MIT/X11 licensed. Please see the -- COPYING file in the source package for more information. -- diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_incidents_handling/incidents_handling/incidents_handling.lib.lua --- a/mod_incidents_handling/incidents_handling/incidents_handling.lib.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_incidents_handling/incidents_handling/incidents_handling.lib.lua Tue Mar 11 18:44:01 2014 +0100 @@ -13,7 +13,7 @@ -- // Util and Functions // local function ft_str() - local d = os_date("%FT%T%z"):gsub("^(.*)(%+%d+)", function(dt, z) + local d = os_date("%FT%T%z"):gsub("^(.*)(%+%d+)", function(dt, z) if z == "+0000" then return dt.."Z" else return dt..z end end) return d @@ -24,7 +24,7 @@ title = (i_type == "report" and "Incident report form") or (i_type == "request" and "Request for assistance with incident form"), instructions = "Started/Ended Time, Contacts, Sources and Targets of the attack are mandatory. See RFC 5070 for further format instructions.", { name = "FORM_TYPE", type = "hidden", value = "http://jabber.org/protocol/commands" }, - + { name = "name", type = "hidden", value = my_host }, { name = "entity", type ="text-single", label = "Remote entity to query" }, { name = "started", type = "text-single", label = "Incident Start Time" }, @@ -34,18 +34,18 @@ desc = "Description syntax is: " }, { name = "contacts", type = "text-multi", label = "Contacts", desc = "Contacts entries format is:
- separated by new lines" }, - { name = "related", type = "text-multi", label = "Related Incidents", + { name = "related", type = "text-multi", label = "Related Incidents", desc = "Related incidents entries format is: - separated by new lines" }, - { name = "impact", type = "text-single", label = "Impact Assessment", + { name = "impact", type = "text-single", label = "Impact Assessment", desc = "Impact assessment format is: " }, - { name = "sources", type = "text-multi", label = "Attack Sources", + { name = "sources", type = "text-multi", label = "Attack Sources", desc = "Attack sources format is:
" }, - { name = "targets", type = "text-multi", label = "Attack Targets", + { name = "targets", type = "text-multi", label = "Attack Targets", desc = "Attack target format is:
" } } if i_type == "request" then - table.insert(layout, { + table.insert(layout, { name = "expectation", type = "list-single", label = "Expected action from remote entity", @@ -67,7 +67,7 @@ title = "Stored Incidents List", instructions = "You can select and view incident reports here, if a followup/response is possible it'll be noted in the step after selection.", { name = "FORM_TYPE", type = "hidden", value = "http://jabber.org/protocol/commands" }, - { + { name = "ids", type = "list-single", label = "Stored Incidents", @@ -106,7 +106,7 @@ if contact.postaladdr then insert_fixed(layout, "--> Postal Address: "..contact.postaladdr) end end - insert_fixed(layout, "Related Activity --") + insert_fixed(layout, "Related Activity --") for _, related in ipairs(incident.data.related) do insert_fixed(layout, string.format("Name: %s ID: %s", related.name, related.text)) end @@ -205,7 +205,7 @@ postaladdr = postaladdr } else - object.contacts[#object.contacts + 1] = { + object.contacts[#object.contacts + 1] = { role = tag.attr.role, ext_role = (tag.attr["ext-role"] and true) or nil, type = tag.attr.type, @@ -226,7 +226,7 @@ end elseif tag.name == "Assessment" then local impact = tag:get_child("Impact") - object.assessment = { lang = impact.attr.lang, severity = impact.attr.severity, completion = impact.attr.completion, type = impact.attr.type } + object.assessment = { lang = impact.attr.lang, severity = impact.attr.severity, completion = impact.attr.completion, type = impact.attr.type } elseif tag.name == "EventData" then local source = tag:get_child("Flow").tags[1] local target = tag:get_child("Flow").tags[2] @@ -244,15 +244,15 @@ local noderole = { cat = entry:get_child("NodeRole").attr.category, ext = entry:get_child("NodeRole").attr["ext-category"] } local current = #object.event_data.targets + 1 object.event_data.targets[current] = { addresses = {}, noderole = noderole } - for _, tag in ipairs(entry.tags) do + for _, tag in ipairs(entry.tags) do object.event_data.targets[current].addresses[#object.event_data.targets[current].addresses + 1] = { text = tag:get_text(), cat = tag.attr.category, ext = tag.attr["ext-category"] } end end - if expectation then - object.event_data.expectation = { + if expectation then + object.event_data.expectation = { action = expectation.attr.action, desc = expectation:get_child("Description") and expectation:get_child("Description"):get_text() - } + } end elseif tag.name == "History" then object.history = {} @@ -268,7 +268,7 @@ local function stanza_parser(stanza) local object = {} - + if stanza:get_child("report", xmlns_inc) then local report = st.clone(stanza):get_child("report", xmlns_inc):get_child("Incident", xmlns_iodef) for _, tag in ipairs(report.tags) do do_tag_mapping(tag, object) end @@ -295,8 +295,8 @@ :tag("EndTime"):text(object.end_time):up() :tag("ReportTime"):text(object.report_time):up() :tag("Description", { ["xml:lang"] = object.desc.lang }):text(object.desc.text):up():up(); - - local incident = stanza:get_child(s_type, xmlns_inc):get_child("Incident", xmlns_iodef) + + local incident = stanza:get_child(s_type, xmlns_inc):get_child("Incident", xmlns_iodef) for _, contact in ipairs(object.contacts) do incident:tag("Contact", { role = (contact.ext_role and "ext-role") or contact.role, @@ -308,18 +308,18 @@ :tag("PostalAddress"):text(contact.postaladdr):up() :tag("AdditionalData") :tag("jid", { xmlns = contact.xmlns }):text(contact.jid):up():up():up() - + end incident:tag("RelatedActivity"):up(); for _, related in ipairs(object.related) do - incident:get_child("RelatedActivity") + incident:get_child("RelatedActivity") :tag("IncidentID", { name = related.name }):text(related.text):up(); end incident:tag("Assessment") - :tag("Impact", { + :tag("Impact", { lang = object.assessment.lang, severity = object.assessment.severity, completion = object.assessment.completion, @@ -362,12 +362,12 @@ if object.history then local history = incident:tag("History"):up(); - + for _, item in ipairs(object.history) do history:tag("HistoryItem", { action = item.action }) :tag("DateTime"):text(item.date):up() :tag("Description"):text(item.desc):up():up(); - end + end end -- Sanitize contact empty tags @@ -376,19 +376,19 @@ for i, check in ipairs(tag) do if (check.name == "Email" or check.name == "PostalAddress" or check.name == "Telephone") and not check:get_text() then - table.remove(tag, i) + table.remove(tag, i) end - end + end end end if s_type == "request" then stanza.attr.type = "get" elseif s_type == "response" then stanza.attr.type = "set" - else stanza.attr.type = "set" end + else stanza.attr.type = "set" end return stanza end -end +end _M = {} -- wraps methods into the library. diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_incidents_handling/incidents_handling/mod_incidents_handling.lua --- a/mod_incidents_handling/incidents_handling/mod_incidents_handling.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_incidents_handling/incidents_handling/mod_incidents_handling.lua Tue Mar 11 18:44:01 2014 +0100 @@ -27,7 +27,7 @@ local _inc_mt = {} ; _inc_mt.__index = _inc_mt function _inc_mt:init() - self:clean() ; self:save() + self:clean() ; self:save() end function _inc_mt:clean() @@ -68,7 +68,7 @@ if not _lang or not _dtext then return false end local desc = { text = _dtext, lang = _lang } - local contacts = {} + local contacts = {} for contact in _contacts:gmatch("[%w%p]+%s[%w%p]+%s[%w%p]+") do local address, atype, role = contact:match("^([%w%p]+)%s([%w%p]+)%s([%w%p]+)$") if not address or not atype or not role then fail = true ; break end @@ -117,7 +117,7 @@ noderole_ext = ih_lib.get_type(cat, "noderole") if not _preprocess[noderole] then _preprocess[noderole] = { addresses = {}, ext = noderole_ext } end - + _preprocess[noderole].addresses[#_preprocess[noderole].addresses + 1] = { text = address, cat = cat, ext = cat_ext } @@ -144,7 +144,7 @@ assessment = assessment, event_data = { sources = sources, targets = targets } } - + self[new_object.data.id.text] = new_object self:clean() ; self:save() return new_object.data.id.text @@ -177,7 +177,7 @@ else module:log("error", "Server %s queried for incident %s but we don't know about it", stanza.attr.from, inc_id) origin.send(st.error_reply(stanza, "cancel", "item-not-found")) ; return true - end + end end local function request_handler(event) @@ -213,7 +213,7 @@ if state then if state.step == 1 then - if data.action == "cancel" then + if data.action == "cancel" then return { status = "canceled" } elseif data.action == "prev" then return { status = "executing", actions = { "next", default = "next" }, form = list_incidents_layout }, {} @@ -287,7 +287,7 @@ if state then if data.action == "cancel" then return { status = "canceled" } end local fields = send_layout:data(data.form) - + if fields.started and fields.ended and fields.reported and fields.description and fields.contacts and fields.impact and fields.sources and fields.targets and fields.entity then if formtype == "request" and not fields.expectation then return err_no_fields end @@ -303,7 +303,7 @@ return { status = "completed", info = string.format("Incident %s sent to %s.", formtype, fields.entity) } else return err_no_fields - end + end else return { status = "executing", form = send_layout }, "executing" end @@ -348,5 +348,5 @@ module.restore = function(data) incidents = data.incidents or {} - setmetatable(incidents, _inc_mt) ; incidents:init() + setmetatable(incidents, _inc_mt) ; incidents:init() end diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_json_streams/strophe.jsonstreams.js --- a/mod_json_streams/strophe.jsonstreams.js Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_json_streams/strophe.jsonstreams.js Tue Mar 11 18:44:01 2014 +0100 @@ -11,7 +11,7 @@ var parseXMLString = function(xmlStr) { var xmlDoc = null; if (window.ActiveXObject) { - xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); + xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async=false; xmlDoc.loadXML(xmlStr); } else { diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_lastlog/mod_lastlog.lua --- a/mod_lastlog/mod_lastlog.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_lastlog/mod_lastlog.lua Tue Mar 11 18:44:01 2014 +0100 @@ -1,4 +1,4 @@ -local datamanager = require "util.datamanager"; +local datamanager = require "util.datamanager"; local jid = require "util.jid"; local time = os.time; local log_ip = module:get_option_boolean("lastlog_ip_address", false); diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_latex/mod_latex.lua --- a/mod_latex/mod_latex.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_latex/mod_latex.lua Tue Mar 11 18:44:01 2014 +0100 @@ -9,15 +9,15 @@ local origin, stanza = data.origin, data.stanza; local body = stanza:child_with_name("body"); if not body then return; end - + body = body:get_text(); if not body:match("%$%$") then return; end - + local html = st.stanza("html", { xmlns = xmlns_xhtmlim }) :tag("body", { xmlns = xmlns_xhtml }); - + local in_latex, last_char; for snippet, up_to in body:gmatch("(.-)%$%$()") do last_char = up_to; @@ -29,13 +29,13 @@ -- Add text to HTML, next snippet is latex in_latex = true; html:tag("span"):text(snippet):up(); - + end end if last_char < #body then html:tag("span"):text(body:sub(last_char, #body)):up(); end - + for n, tag in ipairs(stanza.tags) do module:log("debug", "Tag: %s|%s", tag.attr.xmlns or "", tag.name or ""); if tag.name == "html" and tag.attr.xmlns == xmlns_xhtmlim then @@ -48,7 +48,7 @@ return; end end - + stanza[#stanza+1] = html; stanza.tags[#stanza.tags+1] = html; end diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_log_messages_sql/mod_log_messages_sql.lua --- a/mod_log_messages_sql/mod_log_messages_sql.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_log_messages_sql/mod_log_messages_sql.lua Tue Mar 11 18:44:01 2014 +0100 @@ -62,15 +62,15 @@ end params = params or { driver = "SQLite3" }; - + if params.driver == "SQLite3" then params.database = resolve_relative_path(prosody.paths.data or ".", params.database or "prosody.sqlite"); end - + assert(params.driver and params.database, "Both the SQL driver and the database need to be specified"); assert(connect()); - + end function getsql(sql, ...) @@ -85,7 +85,7 @@ local ok, err = stmt:execute(...); if not ok and not test_connection() then error("connection failed"); end if not ok then return nil, err; end - + return stmt; end function setsql(sql, ...) diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_mam_muc_sql/mod_mam_muc_sql.lua --- a/mod_mam_muc_sql/mod_mam_muc_sql.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_mam_muc_sql/mod_mam_muc_sql.lua Tue Mar 11 18:44:01 2014 +0100 @@ -91,18 +91,18 @@ end params = params or { driver = "SQLite3" }; - + if params.driver == "SQLite3" then params.database = resolve_relative_path(prosody.paths.data or ".", params.database or "prosody.sqlite"); end - + assert(params.driver and params.database, "Both the SQL driver and the database need to be specified"); dburi = db2uri(params); connection = connections[dburi]; - + assert(connect()); - + end function getsql(sql, ...) @@ -117,7 +117,7 @@ local ok, err = stmt:execute(...); if not ok and not test_connection() then error("connection failed"); end if not ok then return nil, err; end - + return stmt; end function setsql(sql, ...) @@ -290,7 +290,7 @@ sql.rollback(); end --[[ This was dropped from the spec - if ok then + if ok then stanza:tag("archived", { xmlns = xmlns_mam, by = host, id = id }):up(); end --]] diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_mam_sql/mod_mam_sql.lua --- a/mod_mam_sql/mod_mam_sql.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_mam_sql/mod_mam_sql.lua Tue Mar 11 18:44:01 2014 +0100 @@ -99,18 +99,18 @@ end params = params or { driver = "SQLite3" }; - + if params.driver == "SQLite3" then params.database = resolve_relative_path(prosody.paths.data or ".", params.database or "prosody.sqlite"); end - + assert(params.driver and params.database, "Both the SQL driver and the database need to be specified"); dburi = db2uri(params); connection = connections[dburi]; - + assert(connect()); - + end function getsql(sql, ...) @@ -135,7 +135,7 @@ return nil, "connection failed"; end if not ok then return nil, err; end - + return stmt; end function setsql(sql, ...) @@ -401,7 +401,7 @@ sql.rollback(); end --[[ This was dropped from the spec - if ok then + if ok then stanza:tag("archived", { xmlns = xmlns_mam, by = host, id = id }):up(); end --]] diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_message_logging/mod_message_logging.lua --- a/mod_message_logging/mod_message_logging.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_message_logging/mod_message_logging.lua Tue Mar 11 18:44:01 2014 +0100 @@ -53,14 +53,14 @@ local function handle_incoming_message(event) local origin, stanza = event.origin, event.stanza; local message_type = stanza.attr.type; - + if message_type == "error" then return; end - + local from, to = jid_bare(stanza.attr.from), jid_bare(stanza.attr.to); local body = stanza:get_child("body"); if not body then return; end body = body:get_text(); - + local f = open_files[to]; if not f then return; end if message_type == "groupchat" then @@ -75,14 +75,14 @@ local function handle_outgoing_message(event) local origin, stanza = event.origin, event.stanza; local message_type = stanza.attr.type; - + if message_type == "error" or message_type == "groupchat" then return; end - + local from, to = jid_bare(stanza.attr.from), jid_bare(stanza.attr.to); local body = stanza:get_child("body"); if not body then return; end body = body:get_text(); - + local f = open_files[from]; if not f then return; end body = body:gsub("\n", "\n "); -- Indent newlines @@ -100,11 +100,11 @@ module:hook("message/bare", handle_incoming_message, 1); module:hook("message/full", handle_incoming_message, 1); - + module:hook("pre-message/bare", handle_outgoing_message, 1); module:hook("pre-message/full", handle_outgoing_message, 1); module:hook("pre-message/host", handle_outgoing_message, 1); - + end function module.command(arg) diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_motd_sequential/mod_motd_sequential.lua --- a/mod_motd_sequential/mod_motd_sequential.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_motd_sequential/mod_motd_sequential.lua Tue Mar 11 18:44:01 2014 +0100 @@ -2,7 +2,7 @@ -- Copyright (C) 2008-2010 Matthew Wild -- Copyright (C) 2008-2010 Waqas Hussain -- Copyright (C) 2010 Jeff Mitchell --- +-- -- This project is MIT/X11 licensed. Please see the -- COPYING file in the source package for more information. -- diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_muc_log/mod_muc_log.lua --- a/mod_muc_log/mod_muc_log.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_muc_log/mod_muc_log.lua Tue Mar 11 18:44:01 2014 +0100 @@ -18,7 +18,7 @@ function log_if_needed(event) local stanza = event.stanza; - + if (stanza.name == "presence") or (stanza.name == "iq") or (stanza.name == "message" and tostring(stanza.attr.type) == "groupchat") @@ -34,19 +34,19 @@ local muc_to = nil local muc_from = nil; local already_joined = false; - + if room._data.hidden then -- do not log any data of private rooms return; end if not room._data.logging then -- do not log where logging is not enabled return; end - + if stanza.name == "presence" and stanza.attr.type == nil then muc_from = stanza.attr.to; if room._occupants and room._occupants[stanza.attr.to] then already_joined = true; - stanza:tag("alreadyJoined"):text("true"); + stanza:tag("alreadyJoined"):text("true"); end elseif stanza.name == "iq" and stanza.attr.type == "set" then -- kick, to is the room, from is the admin, nick who is kicked is attr of iq->query->item if stanza.tags[1] and stanza.tags[1].name == "query" then @@ -74,11 +74,11 @@ local data = data_load(node, host, datastore .. "/" .. today); local realFrom = stanza.attr.from; local realTo = stanza.attr.to; - + if data == nil then data = {}; end - + stanza.attr.from = muc_from; stanza.attr.to = muc_to; data[#data + 1] = "" .. tostring(stanza) .. "\n"; @@ -131,7 +131,7 @@ module:hook("message/bare", log_if_needed, 1); if log_presences then module:hook("iq/bare", log_if_needed, 1); - module:hook("presence/full", log_if_needed, 1); + module:hook("presence/full", log_if_needed, 1); end module:log("debug", "module mod_muc_log loaded!"); diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_muc_log_http/muc_log_http/mod_muc_log_http.lua --- a/mod_muc_log_http/muc_log_http/mod_muc_log_http.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_muc_log_http/muc_log_http/mod_muc_log_http.lua Tue Mar 11 18:44:01 2014 +0100 @@ -620,12 +620,12 @@ node = urldecode(node); - if not html.doc then + if not html.doc then response.status_code = 500; return response:send(handle_error(response.status_code, "Muc Theme is not loaded.")); end - + if node then room = hosts[my_host].modules.muc.rooms[node.."@"..my_host]; end if node and not room then response.status_code = 404; @@ -638,7 +638,7 @@ if not node then -- room list for component - return response:send(create_doc(generate_room_list(my_host))); + return response:send(create_doc(generate_room_list(my_host))); elseif not day then -- room's listing return response:send(create_doc(generate_day_room_content(node.."@"..my_host))); else diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_muc_log_http/muc_log_http/themes/prosody/day_time.html --- a/mod_muc_log_http/muc_log_http/themes/prosody/day_time.html Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_muc_log_http/muc_log_http/themes/prosody/day_time.html Tue Mar 11 18:44:01 2014 +0100 @@ -1,1 +1,1 @@ -[###TIME###] +[###TIME###] diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_muc_log_http/muc_log_http/themes/prosody/doc.html --- a/mod_muc_log_http/muc_log_http/themes/prosody/doc.html Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_muc_log_http/muc_log_http/themes/prosody/doc.html Tue Mar 11 18:44:01 2014 +0100 @@ -22,7 +22,7 @@ tmp[0] = Number(tmp[0]) + timezoneOffset; d = new Date(0, 0, 0, 0, 0, Number(tmp[0])); } - + eles[i].innerHTML = (d.getHours() <= 9 ? "0" + d.getHours() : d.getHours()) + ":"; eles[i].innerHTML += (d.getMinutes() <= 9 ? "0" + d.getMinutes() : d.getMinutes()) + ":"; eles[i].innerHTML += (d.getSeconds() <= 9 ? "0" + d.getSeconds() : d.getSeconds()); diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_onhold/mod_onhold.lua --- a/mod_onhold/mod_onhold.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_onhold/mod_onhold.lua Tue Mar 11 18:44:01 2014 +0100 @@ -2,7 +2,7 @@ -- Copyright (C) 2008-2009 Matthew Wild -- Copyright (C) 2008-2009 Waqas Hussain -- Copyright (C) 2009 Jeff Mitchell --- +-- -- This project is MIT/X11 licensed. Please see the -- COPYING file in the source package for more information. -- @@ -48,7 +48,7 @@ local node, host = session.username, session.host; local from; local de_stanza; - + local data = datamanager.list_load(node, host, "onhold"); local newdata = {}; if not data then return nil; end diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_onions/mod_onions.lua --- a/mod_onions/mod_onions.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_onions/mod_onions.lua Tue Mar 11 18:44:01 2014 +0100 @@ -31,7 +31,7 @@ local socks5listener = { default_port = proxy_port, default_mode = "*a", default_interface = "*" }; local function socks5_connect_sent(conn, data) - + local session = sessions[conn]; if #data < 5 then @@ -48,7 +48,7 @@ end module:log("debug", "Succesfully connected to SOCKS5 proxy."); - + local response = byte(data, 4); if response == 0x01 then @@ -96,14 +96,14 @@ end end end - + session.open_stream = function () session.sends2s(st.stanza("stream:stream", { xmlns='jabber:server', ["xmlns:db"]='jabber:server:dialback', ["xmlns:stream"]='http://etherx.jabber.org/streams', from=session.from_host, to=session.to_host, version='1.0', ["xml:lang"]='en'}):top_tag()); end - + conn.setlistener(conn, listener); listener.register_outgoing(conn, session); @@ -147,7 +147,7 @@ -- Socks version 5, 1 method, no auth conn:write(c(5) .. c(1) .. c(0)); - + sessions[conn].socks5_handler = socks5_handshake_sent; end @@ -173,7 +173,7 @@ end local function connect_socks5(host_session, connect_host, connect_port) - + local conn, handler = socket.tcp(); module:log("debug", "Connecting to " .. connect_host .. ":" .. connect_port); diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_openid/mod_openid.lua --- a/mod_openid/mod_openid.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_openid/mod_openid.lua Tue Mar 11 18:44:01 2014 +0100 @@ -17,7 +17,7 @@ local function genkey(length) -- FIXME not cryptographically secure str = {} - + for i = 1,length do local rand = math.random(33, 126) table.insert(str, string.char(rand)) @@ -29,7 +29,7 @@ local function tokvstring(dict) -- key-value encoding for a dictionary [#4.1.3] local str = "" - + for k,v in pairs(dict) do str = str..k..":"..v.."\n" end @@ -90,7 +90,7 @@ for i=0,10 do random = random..string.char(math.random(33,126)) end - + local timestamp = os.date("%Y-%m-%dT%H:%M:%SZ", utctime()) return timestamp..random @@ -142,7 +142,7 @@ local function handle_endpoint(method, body, request) module:log("debug", "Request at OpenID provider endpoint") - + local params = nil if method == "GET" then @@ -153,7 +153,7 @@ -- TODO error return response_404 end - + module:log("debug", "Request Parameters:\n"..humane(params)) if params["openid.ns"] == openidns then @@ -202,7 +202,7 @@ -- Verify the return url [#9.2.1] -- TODO implement return url verification end - + if params["openid.claimed_id"] and params["openid.identity"] then -- asserting an identifier [#9.1] @@ -264,10 +264,10 @@ end module:log("debug", "Signature is: "..is_valid) - + openidresponse = { ns = openidns, - is_valid = is_valid, + is_valid = is_valid, } -- Delete this association @@ -305,7 +305,7 @@ else endpointurl = string.format("http://%s:%s/%s", host, port, base) end - + local nonce = nonce() local key = genkey(32) local assoc_handle = newassoc(key) @@ -380,11 +380,11 @@ user, domain = jidutil.split(id) local exists = usermanager.user_exists(user_name, user_domain) - + if not exists then - return response_404 + return response_404 end - + local endpointurl = "" if port == '' then endpointurl = string.format("http://%s/%s", host, base) @@ -395,7 +395,7 @@ local head = string.format("Prosody OpenID : %s@%s", user_name, user_domain) -- OpenID HTML discovery [#7.3] head = head .. string.format('', endpointurl) - + local content = 'request.url.path: ' .. request.url.path .. '
' content = content .. 'host+port: ' .. request.headers.host .. '
' content = content .. 'host: ' .. tostring(host) .. '
' @@ -403,9 +403,9 @@ content = content .. 'user_name: ' .. user_name .. '
' content = content .. 'user_domain: ' .. user_domain .. '
' content = content .. 'exists: ' .. tostring(exists) .. '
' - + local body = string.format('

%s

', content) - + local data = string.format([[ diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_pastebin/mod_pastebin.lua --- a/mod_pastebin/mod_pastebin.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_pastebin/mod_pastebin.lua Tue Mar 11 18:44:01 2014 +0100 @@ -59,15 +59,15 @@ event.response.headers = default_headers; return event.response:send("Invalid paste id, perhaps it expired?"); end - + --module:log("debug", "Received request, replying: %s", pastes[pasteid].text); - + return pastes[pasteid]; end function check_message(data) local origin, stanza = data.origin, data.stanza; - + local body, bodyindex, htmlindex; for k,v in ipairs(stanza) do if v.name == "body" then @@ -76,12 +76,12 @@ htmlindex = k; end end - + if not body then return; end body = body:get_text(); - + --module:log("debug", "Body(%s) length: %d", type(body), #(body or "")); - + if body and ( ((#body > length_threshold) and (utf8_length(body) > length_threshold)) or @@ -92,13 +92,13 @@ body = body:gsub("^" .. trigger_string, "", 1); end local url = pastebin_text(body); - module:log("debug", "Pasted message as %s", url); + module:log("debug", "Pasted message as %s", url); --module:log("debug", " stanza[bodyindex] = %q", tostring( stanza[bodyindex])); local summary = (body:sub(1, max_summary_length):gsub(utf8_pattern, drop_invalid_utf8) or ""):match("[^\n]+") or ""; summary = summary:match("^%s*(.-)%s*$"); local summary_prefixed = summary:match("[,:]$"); stanza[bodyindex][1] = (summary_prefixed and (summary.." ") or "")..url; - + if html_preview then local line_count = select(2, body:gsub("\n", "%0")) + 1; local link_text = ("[view %spaste (%d line%s)]"):format(summary_prefixed and "" or "rest of ", line_count, line_count == 1 and "" or "s"); diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_pubsub_eventsource/mod_pubsub_eventsource.lua --- a/mod_pubsub_eventsource/mod_pubsub_eventsource.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_pubsub_eventsource/mod_pubsub_eventsource.lua Tue Mar 11 18:44:01 2014 +0100 @@ -28,7 +28,7 @@ "Access-Control-Allow-Methods: GET"; "Access-Control-Max-Age: 7200"; ""; - ""; + ""; }, "\r\n")); local clientlist = streams[node]; diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_pubsub_feeds/mod_pubsub_feeds.lua --- a/mod_pubsub_feeds/mod_pubsub_feeds.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_pubsub_feeds/mod_pubsub_feeds.lua Tue Mar 11 18:44:01 2014 +0100 @@ -112,7 +112,7 @@ end end end - + if use_pubsubhubub and not item.subscription then --module:log("debug", "check if %s has a hub", item.node); local hub = feed.links and feed.links.hub; @@ -129,7 +129,7 @@ if item.data and item.last_update then headers["If-Modified-Since"] = date("!%a, %d %b %Y %H:%M:%S %Z", item.last_update); end - http.request(item.url, { headers = headers }, function(data, code) + http.request(item.url, { headers = headers }, function(data, code) if code == 200 then item.data = data; if callback then callback(item) end @@ -146,7 +146,7 @@ for node, item in pairs(feed_list) do --FIXME Don't fetch feeds which have a subscription -- Otoho, what if the subscription expires or breaks? - if force or item.last_update + refresh_interval < now then + if force or item.last_update + refresh_interval < now then --module:log("debug", "checking %s", item.node); fetch(item, update_entry); end @@ -156,7 +156,7 @@ local function format_url(node) return module:http_url(nil, "/callback") .. "?node=" .. urlencode(node); -end +end function subscribe(feed, want) want = want or "subscribe"; diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_pubsub_github/mod_pubsub_github.lua --- a/mod_pubsub_github/mod_pubsub_github.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_pubsub_github/mod_pubsub_github.lua Tue Mar 11 18:44:01 2014 +0100 @@ -12,7 +12,7 @@ if not data then return "Invalid JSON. From you of all people..."; end - + for _, commit in ipairs(data.commits) do local ok, err = pubsub_service:publish(node, true, data.repository.name, st.stanza("item", { id = data.repository.name, xmlns = "http://jabber.org/protocol/pubsub" }) @@ -27,7 +27,7 @@ :up() ); end - + module:log("debug", "Handled POST: \n%s\n", tostring(event.request.body)); return "Thank you Github!"; end diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_pubsub_googlecode/mod_pubsub_googlecode.lua --- a/mod_pubsub_googlecode/mod_pubsub_googlecode.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_pubsub_googlecode/mod_pubsub_googlecode.lua Tue Mar 11 18:44:01 2014 +0100 @@ -21,7 +21,7 @@ function handle_POST(event) local request = event.request; local body = request.body; - + if auth_key then local digest_header = request.headers["google-code-project-hosting-hook-hmac"]; local digest = hmac_md5(auth_key, body, true); @@ -30,9 +30,9 @@ return "No thanks."; end end - + local data = json.decode(body); - + local project = data.project_name or "somewhere"; for _, rev in ipairs(data.revisions) do if rev.url:match("^http://wiki.") then @@ -49,7 +49,7 @@ end rev.message = "wiki ("..(what or "unknown page").."): "..rev.message; end - + local name = rev.author; local email = name:match("<([^>]+)>$"); if email then diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_pubsub_mqtt/mod_pubsub_mqtt.lua --- a/mod_pubsub_mqtt/mod_pubsub_mqtt.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_pubsub_mqtt/mod_pubsub_mqtt.lua Tue Mar 11 18:44:01 2014 +0100 @@ -66,7 +66,7 @@ session.subscriptions[topic] = true; node_subs[session] = true; end - + end function packet_handlers.pingreq(session, packet) diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_pubsub_mqtt/mqtt.lib.lua --- a/mod_pubsub_mqtt/mqtt.lib.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_pubsub_mqtt/mqtt.lib.lua Tue Mar 11 18:44:01 2014 +0100 @@ -44,7 +44,7 @@ packet.dup = bit.band(header, 0x08) == 0x08; packet.qos = bit.rshift(bit.band(header, 0x06), 1); packet.retain = bit.band(header, 0x01) == 0x01; - + -- Get length local length, multiplier = 0, 1; repeat @@ -129,7 +129,7 @@ end end local header = string.char(bit.lshift(type_num, 4)); - + if packet.type == "publish" then local topic = packet.topic or ""; packet.data = string.char(bit.band(#topic, 0xff00), bit.band(#topic, 0x00ff))..topic..packet.data; @@ -140,7 +140,7 @@ end packet.data = table.concat(t); end - + -- Get length local length = #(packet.data or ""); repeat @@ -151,7 +151,7 @@ end header = header..string.char(digit); -- FIXME: ... until length <= 0; - + return header..(packet.data or ""); end diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_pubsub_pivotaltracker/mod_pubsub_pivotaltracker.lua --- a/mod_pubsub_pivotaltracker/mod_pubsub_pivotaltracker.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_pubsub_pivotaltracker/mod_pubsub_pivotaltracker.lua Tue Mar 11 18:44:01 2014 +0100 @@ -32,23 +32,23 @@ function handle_POST(event) local data = lom.parse(event.request.body); - + if not data then return "Invalid XML. From you of all people..."; end - + data = stanza_from_lom(data); - + if data.name ~= "activity" then return "Unrecognised XML element: "..data.name; end - + local activity_id = data:get_child("id"):get_text(); local description = data:get_child("description"):get_text(); local author_name = data:get_child("author"):get_text(); local story = data:get_child("stories"):get_child("story"); local story_link = story:get_child("url"):get_text(); - + local ok, err = pubsub_service:publish(node, true, "activity", st.stanza("item", { id = "activity", xmlns = "http://jabber.org/protocol/pubsub" }) :tag("entry", { xmlns = "http://www.w3.org/2005/Atom" }) :tag("id"):text(activity_id):up() @@ -59,7 +59,7 @@ :tag("name"):text(author_name):up() :up() ); - + module:log("debug", "Handled POST: \n%s\n", tostring(event.request.body)); return "Thank you Pivotal!"; end diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_pubsub_twitter/mod_pubsub_twitter.lua --- a/mod_pubsub_twitter/mod_pubsub_twitter.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_pubsub_twitter/mod_pubsub_twitter.lua Tue Mar 11 18:44:01 2014 +0100 @@ -9,7 +9,7 @@ -- prosody = "prosody xmpp"; -- } -- twitter_pull_interval = 20 -- minutes --- +-- local pubsub = module:depends"pubsub"; @@ -40,11 +40,11 @@ local function publish_result(search_name, result) local node, id = search_name, result.id_str; --"Tue, 02 Apr 2013 15:40:54 +0000" - local timestamp_date, timestamp_month, timestamp_year, timestamp_time = + local timestamp_date, timestamp_month, timestamp_year, timestamp_time = result.created_at:match(" (%d+) (%a+) (%d+) (%d%d:%d%d:%d%d)"); - + local timestamp = ("%s-%s-%sT%sZ"):format(timestamp_year, month_number[timestamp_month], timestamp_date, timestamp_time); - + local item = st.stanza("item", { xmlns = "http://jabber.org/protocol/pubsub", id = id }) :tag("entry", { xmlns = xmlns_atom }) :tag("id"):text(id):up() @@ -55,9 +55,9 @@ :tag("published"):text(timestamp):up() :tag("title"):text(result.text):up() :tag("link", { rel = "alternate" , href = "https://twitter.com/"..result.from_user.."/status/"..id}):up(); - + module:log("debug", "Publishing Twitter result: %s", tostring(item)); - + local ok, err = pubsub.service:publish(node, true, id, item); if not ok then if err == "item-not-found" then -- try again @@ -106,10 +106,10 @@ function module.load() local config_searches = set.new(array.collect(it.keys(twitter_searches))); local current_searches = set.new(array.collect(it.keys(active_searches))); - + local disable_searches = current_searches - config_searches; local new_searches = config_searches - current_searches; - + for search_name in disable_searches do module:log("debug", "Disabled old Twitter search '%s'", search_name); active_searches[search_name] = nil; diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_register_json/register_json/mod_register_json.lua --- a/mod_register_json/register_json/mod_register_json.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_register_json/register_json/mod_register_json.lua Tue Mar 11 18:44:01 2014 +0100 @@ -66,7 +66,7 @@ end local function check_mail(address) - for _, pattern in ipairs(fm_patterns) do + for _, pattern in ipairs(fm_patterns) do if address:match(pattern) then return false end end return true @@ -93,7 +93,7 @@ if request.method ~= "POST" then return http_response(event, 405, "Bad method.", {["Allow"] = "POST"}) end - + local req_body -- We check that what we have is valid JSON wise else we throw an error... if not pcall(function() req_body = json_decode(b64_decode(request.body)) end) then @@ -113,11 +113,11 @@ if token ~= auth_token then module:log("warn", "%s tried to retrieve a registration token for %s@%s", request.ip, username, module.host) return http_response(event, 401, "Auth token is invalid! The attempt has been logged.") - else + else -- Blacklist can be checked here. - if blacklist:contains(ip) then + if blacklist:contains(ip) then module:log("warn", "Attempt of reg. submission to the JSON servlet from blacklisted address: %s", ip) - return http_response(event, 403, "The specified address is blacklisted, sorry.") + return http_response(event, 403, "The specified address is blacklisted, sorry.") end if not check_mail(mail) then @@ -142,7 +142,7 @@ if throttle_time and not whitelist:contains(ip) then if not recent_ips[ip] then recent_ips[ip] = os_time() - else + else if os_time() - recent_ips[ip] < throttle_time then recent_ips[ip] = os_time() module:log("warn", "JSON Registration request from %s has been throttled.", req_body["ip"]) @@ -208,7 +208,7 @@ if request.method == "GET" then if path == "" then return r_template(event, "form") - end + end if valid_files[path] then local data = open_file(valid_files[path]) @@ -223,25 +223,25 @@ if not pending[uuid] then return r_template(event, "fail") else - local username, password, ip = + local username, password, ip = pending[uuid].node, pending[uuid].password, pending[uuid].ip local ok, error = usermanager.create_user(username, password, module.host) - if ok then + if ok then module:fire_event( - "user-registered", + "user-registered", { username = username, host = module.host, source = "mod_register_json", session = { ip = ip } } ) module:log("info", "Account %s@%s is successfully verified and activated", username, module.host) -- we shall not clean the user from the pending lists as long as registration doesn't succeed. pending[uuid] = nil ; pending_node[username] = nil - return r_template(event, "success") + return r_template(event, "success") else module:log("error", "User creation failed: "..error) return http_response(event, 500, "Encountered server error while creating the user: "..error) end end - end + end else return http_response(event, 405, "Invalid method.") end diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_register_redirect/mod_register_redirect.lua --- a/mod_register_redirect/mod_register_redirect.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_register_redirect/mod_register_redirect.lua Tue Mar 11 18:44:01 2014 +0100 @@ -2,7 +2,7 @@ -- (C) 2011 Kim Alvefur -- -- Registration Redirect module for Prosody --- +-- -- Redirects IP addresses not in the whitelist to a web page or another method to complete the registration. local st = require "util.stanza" @@ -77,7 +77,7 @@ reply:query("jabber:iq:register") :tag("instructions"):text(inst_text):up() end - + if stanza.attr.type == "get" then return origin.send(reply) else diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_s2s_auth_dnssec_srv/mod_s2s_auth_dnssec_srv.lua --- a/mod_s2s_auth_dnssec_srv/mod_s2s_auth_dnssec_srv.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_s2s_auth_dnssec_srv/mod_s2s_auth_dnssec_srv.lua Tue Mar 11 18:44:01 2014 +0100 @@ -1,7 +1,7 @@ -- Copyright (C) 2013 Kim Alvefur -- This file is MIT/X11 licensed. -- --- Implements Secure Delegation using DNS SRV as described in +-- Implements Secure Delegation using DNS SRV as described in -- http://tools.ietf.org/html/draft-miller-xmpp-dnssec-prooftype -- -- Dependecies: diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_s2s_never_encrypt_blacklist/mod_s2s_never_encrypt_blacklist.lua --- a/mod_s2s_never_encrypt_blacklist/mod_s2s_never_encrypt_blacklist.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_s2s_never_encrypt_blacklist/mod_s2s_never_encrypt_blacklist.lua Tue Mar 11 18:44:01 2014 +0100 @@ -7,7 +7,7 @@ local function disable_tls_for_baddies_in(event) local session = event.origin - if bad_servers:contains(session.from_host) or bad_servers_ip:contains(session.conn:ip()) then + if bad_servers:contains(session.from_host) or bad_servers_ip:contains(session.conn:ip()) then module:log("debug", "disabling tls on incoming stream from %s...", tostring(session.from_host)); if libev then session.conn.starttls = false; else session.conn.starttls = nil; end end diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_saslauth_muc/mod_saslauth_muc.lua --- a/mod_saslauth_muc/mod_saslauth_muc.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_saslauth_muc/mod_saslauth_muc.lua Tue Mar 11 18:44:01 2014 +0100 @@ -58,7 +58,7 @@ -- Stanza handlers module:hook("presence/full", function(event) local origin, stanza = event.origin, event.stanza; - + if not stanza.attr.type then -- available presence local room_jid = jid_bare(stanza.attr.to); local room = hosts[module.host].modules.muc.rooms[room_jid]; diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_seclabels/mod_seclabels.lua --- a/mod_seclabels/mod_seclabels.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_seclabels/mod_seclabels.lua Tue Mar 11 18:44:01 2014 +0100 @@ -41,7 +41,7 @@ name = catalog_name, desc = catalog_desc }); - + local function add_labels(catalog, labels, selector) local function add_item(item, name) local name = name or item.name; diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_server_status/mod_server_status.lua --- a/mod_server_status/mod_server_status.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_server_status/mod_server_status.lua Tue Mar 11 18:44:01 2014 +0100 @@ -25,7 +25,7 @@ response_table.doc_closure = '' response_table.stanzas = { elem_header = ' ', elem_closure = ' ', - incoming = ' ', + incoming = ' ', outgoing = ' ' } response_table.hosts = { @@ -44,7 +44,7 @@ if show_hosts then t_builder(show_hosts, hosts_s) end if show_comps then t_builder(show_comps, components) end - + -- build stanza stats if there if prosody.stanza_counter then stats[1] = response_table.stanzas.elem_header @@ -60,7 +60,7 @@ -- build hosts stats if there if hosts_s[1] then hosts_stats[1] = response_table.hosts.elem_header - for _, name in ipairs(hosts_s) do + for _, name in ipairs(hosts_s) do hosts_stats[#hosts_stats+1] = response_table.hosts.status:format( name, hosts[name] and "online" or "offline") end @@ -70,9 +70,9 @@ -- build components stats if there if components[1] then comps_stats[1] = response_table.comps.elem_header - for _, name in ipairs(components) do + for _, name in ipairs(components) do comps_stats[#comps_stats+1] = response_table.comps.status:format( - name, hosts[name] and hosts[name].modules.component and hosts[name].modules.component.connected and "online" or + name, hosts[name] and hosts[name].modules.component and hosts[name].modules.component.connected and "online" or hosts[name] and hosts[name].modules.component == nil and "online" or "offline") end comps_stats[#comps_stats+1] = response_table.comps.elem_closure @@ -97,7 +97,7 @@ end if show_comps then result.components = {} - for _,n in ipairs(show_comps) do + for _,n in ipairs(show_comps) do result.components[n] = hosts[n] and hosts[n].modules.component and hosts[n].modules.component.connected and "online" or hosts[n] and hosts[n].modules.component == nil and "online" or "offline" end @@ -112,7 +112,7 @@ local response = event.response if not json_output then response.headers.content_type = "text/xml" - response:send(forge_response_xml()) + response:send(forge_response_xml()) else response.headers.content_type = "application/json" response:send(forge_response_json()) diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_service_directories/mod_service_directories.lua --- a/mod_service_directories/mod_service_directories.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_service_directories/mod_service_directories.lua Tue Mar 11 18:44:01 2014 +0100 @@ -1,6 +1,6 @@ -- Prosody IM -- Copyright (C) 2011 Waqas Hussain --- +-- -- This project is MIT/X11 licensed. Please see the -- COPYING file in the source package for more information. -- diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_sift/mod_sift.lua --- a/mod_sift/mod_sift.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_sift/mod_sift.lua Tue Mar 11 18:44:01 2014 +0100 @@ -56,28 +56,28 @@ local origin, stanza = event.origin, event.stanza; if stanza.attr.type == "set" then local sifttag = stanza.tags[1]; -- - + -- first, get the elements we are interested in local message = sifttag:get_child("message"); local presence = sifttag:get_child("presence"); local iq = sifttag:get_child("iq"); - + -- for quick lookup, convert the elements into hashtables message = to_hashtable(message); presence = to_hashtable(presence); iq = to_hashtable(iq); - + -- make sure elements were valid if message == false or presence == false or iq == false then origin.send(st.error_reply(stanza, "modify", "bad-request")); return true; end - + local existing = data[origin.full_jid] or {}; -- get existing data, if any data[origin.full_jid] = { presence = presence, message = message, iq = iq }; -- store new data - + origin.send(st.reply(stanza)); -- send back IQ result - + if not existing.presence and not origin.presence and presence then -- TODO send probes end diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_smacks/mod_smacks.lua --- a/mod_smacks/mod_smacks.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_smacks/mod_smacks.lua Tue Mar 11 18:44:01 2014 +0100 @@ -28,7 +28,7 @@ local function can_do_smacks(session, advertise_only) if session.smacks then return false, "unexpected-request", "Stream management is already enabled"; end - + local session_type = session.type; if session_type == "c2s" then if not(advertise_only) and not(session.resource) then -- Fail unless we're only advertising sm @@ -79,17 +79,17 @@ else queue = session.outgoing_stanza_queue; end - + local _send = session.sends2s or session.send; local function new_send(stanza) local attr = stanza.attr; if attr and not attr.xmlns then -- Stanza in default stream namespace local cached_stanza = st.clone(stanza); - + if cached_stanza and cached_stanza:get_child("delay", xmlns_delay) == nil then cached_stanza = cached_stanza:tag("delay", { xmlns = xmlns_delay, from = session.host, stamp = datetime.datetime()}); end - + queue[#queue+1] = cached_stanza; end if session.hibernating then @@ -104,7 +104,7 @@ end return ok, err; end - + if session.sends2s then session.sends2s = new_send; else @@ -119,7 +119,7 @@ end return session_close(...); end - + if not resume then session.handled_stanza_count = 0; add_filter(session, "stanzas/in", function (stanza) @@ -144,9 +144,9 @@ module:log("debug", "Enabling stream management"); session.smacks = true; - + wrap_session(session, false, xmlns_sm); - + local resume_token; local resume = stanza.attr.resume; if resume == "true" or resume == "1" then @@ -163,11 +163,11 @@ function handle_enabled(session, stanza, xmlns_sm) module:log("debug", "Enabling stream management"); session.smacks = true; - + wrap_session(session, false, xmlns_sm); -- FIXME Resume? - + return true; end module:hook_stanza(xmlns_sm2, "enabled", function (session, stanza) return handle_enabled(session, stanza, xmlns_sm2); end, 100); @@ -269,7 +269,7 @@ end); return true; -- Postpone destruction for now end - + end end); @@ -325,11 +325,11 @@ session.send(st.stanza("resumed", { xmlns = xmlns_sm, h = original_session.handled_stanza_count, previd = id })); - + -- Fake an with the h of the from the client original_session:dispatch_stanza(st.stanza("a", { xmlns = xmlns_sm, h = stanza.attr.h })); - + -- Ok, we need to re-send any stanzas that the client didn't see -- ...they are what is now left in the outgoing stanza queue local queue = original_session.outgoing_stanza_queue; diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_sms_clickatell/mod_sms_clickatell.lua --- a/mod_sms_clickatell/mod_sms_clickatell.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_sms_clickatell/mod_sms_clickatell.lua Tue Mar 11 18:44:01 2014 +0100 @@ -1,7 +1,7 @@ -- mod_sms_clickatell -- -- A Prosody module for sending SMS text messages from XMPP using the --- Clickatell gateway's HTTP API +-- Clickatell gateway's HTTP API -- -- Hacked from mod_twitter by Phil Stewart, March 2011. Anything from -- mod_twitter copyright The Guy Who Wrote mod_twitter. Everything else @@ -212,7 +212,7 @@ if message == nil or message == "" then return false; end - + local sms_message = sms_message_prefix..message; local clickatell_base_url = "https://api.clickatell.com/http/sendmsg"; local params = {user=user.data.username, password=user.data.password, api_id=user.data.api_id, from=user.data.source_number, to=number, text=sms_message}; @@ -290,7 +290,7 @@ -- XMPP Register callback -- The client must register with the gateway. In this case, the gateway is --- Clickatell's http api, so we +-- Clickatell's http api, so we function iq_register(origin, stanza) module:log("info", "Register event triggered"); if stanza.attr.type == "get" then @@ -452,7 +452,7 @@ end end - + return true; end @@ -513,7 +513,7 @@ function sms_event_handler(origin, stanza) module:log("debug", "Received stanza: "..stanza:pretty_print()); local to_node, to_host, to_resource = jid_split(stanza.attr.to); - + -- Handle component internals (stanzas directed to component host, mainly iq stanzas) if to_node == nil then local type = stanza.attr.type; @@ -545,12 +545,12 @@ end end end - + -- Handle presence (both component and SMS users) if stanza.name == "presence" then presence_stanza_handler(origin, stanza); end - + -- Handle messages (both component and SMS users) if stanza.name == "message" then message_stanza_handler(origin, stanza); @@ -582,7 +582,7 @@ --]] -- Component registration hooks: these hook in with the Prosody component --- manager +-- manager module:hook("iq/bare", sms_event_handler); module:hook("message/bare", sms_event_handler); module:hook("presence/bare", sms_event_handler); diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_stanza_counter/mod_stanza_counter.lua --- a/mod_stanza_counter/mod_stanza_counter.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_stanza_counter/mod_stanza_counter.lua Tue Mar 11 18:44:01 2014 +0100 @@ -6,7 +6,7 @@ -- Setup, Init functions. -- initialize function counter table on the global object on start local function init_counter() - prosody.stanza_counter = { + prosody.stanza_counter = { iq = { incoming=0, outgoing=0 }, message = { incoming=0, outgoing=0 }, presence = { incoming=0, outgoing=0 } diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_stanza_counter/mod_stanza_counter_http.lua --- a/mod_stanza_counter/mod_stanza_counter_http.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_stanza_counter/mod_stanza_counter_http.lua Tue Mar 11 18:44:01 2014 +0100 @@ -13,7 +13,7 @@ local function res(event, code, body, extras) local response = event.response - + if extras then for header, data in pairs(extras) do response.headers[header] = data end end diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_statistics/mod_statistics.lua --- a/mod_statistics/mod_statistics.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_statistics/mod_statistics.lua Tue Mar 11 18:44:01 2014 +0100 @@ -54,7 +54,7 @@ -- Handle statistics provided by other modules local function item_handlers(host) host = host and (host.."/") or ""; - + return function (event) -- Added local stats = event.item.statistics; local group = host..(stats.name and (stats.name.."::") or ""); @@ -117,7 +117,7 @@ end return 1; end); - + end function module.unload() filters.remove_filter_hook(stats.filter_hook); diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_statistics/prosodytop.lua --- a/mod_statistics/prosodytop.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_statistics/prosodytop.lua Tue Mar 11 18:44:01 2014 +0100 @@ -14,7 +14,7 @@ prosody = { up_since = os.time() }; conn_list = {}; }); - + timer.add_task(0.01, function () local ch = stdscr:getch(); if ch then @@ -26,19 +26,19 @@ end return 0.2; end); - + timer.add_task(0, function () view:draw(); return 1; end); - + --[[ posix.signal(28, function () table.insert(view.conn_list, { jid = "WINCH" }); --view:draw(); end); ]] - + -- Fake socket object around stdin local stdin = { getfd = function () return 0; end; @@ -65,7 +65,7 @@ stdin = server.wrapclient(stdin, "stdin", 0, { onincoming = on_incoming, ondisconnect = function () end }, "*a"); - + local function handle_line(line) local e = { STAT = function (name) return function (value) @@ -79,13 +79,13 @@ setfenv(chunk, e); chunk(); end - + local stats_listener = {}; - + function stats_listener.onconnect(conn) --stdscr:mvaddstr(6, 0, "CONNECTED"); end - + local partial; function stats_listener.onincoming(conn, data) --print("DATA", data) @@ -107,11 +107,11 @@ partial = data:sub(lastpos); end end - + function stats_listener.ondisconnect(conn, err) stdscr:mvaddstr(6, 0, "DISCONNECTED: "..(err or "unknown")); end - + local conn = require "socket".tcp(); assert(conn:connect("localhost", 5782)); handler = server.wrapclient(conn, "localhost", 5279, stats_listener, "*a"); diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_statistics/top.lua --- a/mod_statistics/top.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_statistics/top.lua Tue Mar 11 18:44:01 2014 +0100 @@ -202,7 +202,7 @@ base.listwin = curses.newwin(curses.lines()-(#status_lines+2)-5, 0, #status_lines+1, 0); base.listwin:syncok(); - + base.infowin = curses.newwin(5, 0, curses.lines()-5, 0); base.infowin:mvaddstr(1, 1, "Hello world"); base.infowin:border(0,0,0,0); @@ -210,7 +210,7 @@ base.infowin:refresh(); base:resized(); - + return base; end diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_support_contact/mod_support_contact.lua --- a/mod_support_contact/mod_support_contact.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_support_contact/mod_support_contact.lua Tue Mar 11 18:44:01 2014 +0100 @@ -35,7 +35,7 @@ rostermanager.save_roster(node, host, roster); node, host = jid_split(support_contact); - + if hosts[host] then roster = rostermanager.load_roster(node, host); roster[jid] = {subscription = "both", groups = groups}; diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_swedishchef/mod_swedishchef.lua --- a/mod_swedishchef/mod_swedishchef.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_swedishchef/mod_swedishchef.lua Tue Mar 11 18:44:01 2014 +0100 @@ -1,6 +1,6 @@ -- Copyright (C) 2009 Florian Zeitz -- Copyright (C) 2009 Matthew Wild --- +-- -- This project is MIT/X11 licensed. Please see the -- COPYING file in the source package for more information. -- @@ -8,8 +8,8 @@ local trigger_string = module:get_option_string("swedishchef_trigger"); trigger_string = (trigger_string and trigger_string .. " ") or ""; -local chef = { - { th = "t" }, +local chef = { + { th = "t" }, { ow = "o"}, {["([^%w])o"] = "%1oo", @@ -29,11 +29,11 @@ {a = "e", A = "E"}, {["e([^%w])"] = "e-a%1"}, - {f = "ff"}, + {f = "ff"}, {v = "f", V = "F"}, {w = "v", W = "V"} }; - + function swedish(english) local eng, url = english:match("(.*)(http://.*)$"); if eng then english = eng; end @@ -52,17 +52,17 @@ function check_message(data) local origin, stanza = data.origin, data.stanza; - + local body, bodyindex; for k,v in ipairs(stanza) do if v.name == "body" then body, bodyindex = v, k; end end - + if not body then return; end body = body:get_text(); - + if body and (body:find(trigger_string, 1, true) == 1) then module:log("debug", body:find(trigger_string, 1, true)); stanza[bodyindex][1] = swedish(body:gsub("^" .. trigger_string, "", 1)); diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_tcpproxy/mod_tcpproxy.lua --- a/mod_tcpproxy/mod_tcpproxy.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_tcpproxy/mod_tcpproxy.lua Tue Mar 11 18:44:01 2014 +0100 @@ -30,7 +30,7 @@ function proxy_component(origin, stanza) local ibb_tag = stanza.tags[1]; - if (not (stanza.name == "iq" and stanza.attr.type == "set") + if (not (stanza.name == "iq" and stanza.attr.type == "set") and stanza.name ~= "message") or (not (ibb_tag) @@ -40,7 +40,7 @@ end return; end - + if ibb_tag.name == "open" then -- Starting a new stream local to_host, to_port = ibb_tag.attr[host_attr], ibb_tag.attr[port_attr]; @@ -57,12 +57,12 @@ return origin.send(st.error_reply(stanza, "wait", "resource-constraint", err)); end conn:settimeout(0); - + local success, err = conn:connect(to_host, to_port); if not success and err ~= "timeout" then return origin.send(st.error_reply(stanza, "wait", "remote-server-not-found", err)); end - + local listener,seq = {}, 0; function listener.onconnect(conn) origin.send(st.reply(stanza)); @@ -78,7 +78,7 @@ :tag("close", {xmlns=xmlns_ibb,sid=sid})); close_session(jid, sid); end - + conn = server.wrapclient(conn, to_host, to_port, listener, "*a" ); new_session(jid, sid, conn); elseif ibb_tag.name == "data" then diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_tcpproxy/web/demo.html --- a/mod_tcpproxy/web/demo.html Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_tcpproxy/web/demo.html Tue Mar 11 18:44:01 2014 +0100 @@ -26,7 +26,7 @@ var xmppconn = new Strophe.Connection("/http-bind"); xmppconn.connect("anon.localhost", null, handle_connection_status, 50); - + diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_tcpproxy/web/strophe.js --- a/mod_tcpproxy/web/strophe.js Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_tcpproxy/web/strophe.js Tue Mar 11 18:44:01 2014 +0100 @@ -15,12 +15,12 @@ var chr1, chr2, chr3; var enc1, enc2, enc3, enc4; var i = 0; - + do { chr1 = input.charCodeAt(i++); chr2 = input.charCodeAt(i++); chr3 = input.charCodeAt(i++); - + enc1 = chr1 >> 2; enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); @@ -31,14 +31,14 @@ } else if (isNaN(chr3)) { enc4 = 64; } - + output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4); } while (i < input.length); - + return output; }, - + /** * Decodes a base64 string. * @param {String} input The string to decode. @@ -48,22 +48,22 @@ var chr1, chr2, chr3; var enc1, enc2, enc3, enc4; var i = 0; - + // remove all characters that are not A-Z, a-z, 0-9, +, /, or = input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); - + do { enc1 = keyStr.indexOf(input.charAt(i++)); enc2 = keyStr.indexOf(input.charAt(i++)); enc3 = keyStr.indexOf(input.charAt(i++)); enc4 = keyStr.indexOf(input.charAt(i++)); - + chr1 = (enc1 << 2) | (enc2 >> 4); chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); chr3 = ((enc3 & 3) << 6) | enc4; - + output = output + String.fromCharCode(chr1); - + if (enc3 != 64) { output = output + String.fromCharCode(chr2); } @@ -71,7 +71,7 @@ output = output + String.fromCharCode(chr3); } } while (i < input.length); - + return output; } }; @@ -197,7 +197,7 @@ var md5_ii = function (a, b, c, d, x, s, t) { return md5_cmn(c ^ (b | (~d)), a, b, x, s, t); }; - + /* * Calculate the MD5 of an array of little-endian words, and a bit length */ @@ -218,7 +218,7 @@ oldb = b; oldc = c; oldd = d; - + a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936); d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586); c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819); @@ -235,7 +235,7 @@ d = md5_ff(d, a, b, c, x[i+13], 12, -40341101); c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290); b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329); - + a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510); d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632); c = md5_gg(c, d, a, b, x[i+11], 14, 643717713); @@ -252,7 +252,7 @@ d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784); c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473); b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734); - + a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558); d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463); c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562); @@ -269,7 +269,7 @@ d = md5_hh(d, a, b, c, x[i+12], 11, -421815835); c = md5_hh(c, d, a, b, x[i+15], 16, 530742520); b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651); - + a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844); d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415); c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905); @@ -286,7 +286,7 @@ d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379); c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259); b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551); - + a = safe_add(a, olda); b = safe_add(b, oldb); c = safe_add(c, oldc); @@ -302,14 +302,14 @@ var core_hmac_md5 = function (key, data) { var bkey = str2binl(key); if(bkey.length > 16) { bkey = core_md5(bkey, key.length * chrsz); } - + var ipad = new Array(16), opad = new Array(16); for(var i = 0; i < 16; i++) { ipad[i] = bkey[i] ^ 0x36363636; opad[i] = bkey[i] ^ 0x5C5C5C5C; } - + var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz); return core_md5(opad.concat(hash), 512 + 128); }; @@ -579,7 +579,7 @@ STANZAS: "urn:ietf:params:xml:ns:xmpp-stanzas" }, - /** Function: addNamespace + /** Function: addNamespace * This function is used to extend the current namespaces in * Strophe.NS. It takes a key and a value with the key being the * name of the new namespace, with its actual value. @@ -589,7 +589,7 @@ * Parameters: * (String) name - The name under which the namespace will be * referenced under Strophe.NS - * (String) value - The actual namespace. + * (String) value - The actual namespace. */ addNamespace: function (name, value) { @@ -793,7 +793,7 @@ if (arguments[a].hasOwnProperty(k)) { node.setAttribute(k, arguments[a][k]); } - } + } } } @@ -809,12 +809,12 @@ * Returns: * Escaped text. */ - xmlescape: function(text) + xmlescape: function(text) { text = text.replace(/\&/g, "&"); text = text.replace(//g, ">"); - return text; + return text; }, /** Function: xmlTextNode @@ -1416,7 +1416,7 @@ this.type = type; this.id = id; this.options = options || {matchbare: false}; - + // default matchBare to false if undefined if (!this.options.matchBare) { this.options.matchBare = false; @@ -1446,7 +1446,7 @@ { var nsMatch; var from = null; - + if (this.options.matchBare) { from = Strophe.getBareJidFromJid(elem.getAttribute('from')); } else { @@ -2098,10 +2098,10 @@ /** Function: flush * Immediately send any pending outgoing data. - * + * * Normally send() queues outgoing data until the next idle period * (100ms), which optimizes network use in the common cases when - * several send()s are called in succession. flush() can be used to + * several send()s are called in succession. flush() can be used to * immediately send all pending data. */ flush: function () @@ -2118,9 +2118,9 @@ * Parameters: * (XMLElement) elem - The stanza to send. * (Function) callback - The callback function for a successful request. - * (Function) errback - The callback function for a failed or timed + * (Function) errback - The callback function for a failed or timed * out request. On timeout, the stanza will be null. - * (Integer) timeout - The time specified in milliseconds for a + * (Integer) timeout - The time specified in milliseconds for a * timeout to occur. * * Returns: @@ -2196,7 +2196,7 @@ message: "Cannot queue non-DOMElement." }; } - + this._data.push(element); }, @@ -2279,7 +2279,7 @@ * boolean). When matchBare is true, the from parameter and the from * attribute on the stanza will be matched as bare JIDs instead of * full JIDs. To use this, pass {matchBare: true} as the value of - * options. The default value for matchBare is false. + * options. The default value for matchBare is false. * * The return value should be saved if you wish to remove the handler * with deleteHandler(). @@ -2892,7 +2892,7 @@ if (hold) { this.hold = parseInt(hold, 10); } var wait = bodyWrap.getAttribute('wait'); if (wait) { this.wait = parseInt(wait, 10); } - + var do_sasl_plain = false; var do_sasl_digest_md5 = false; @@ -3092,7 +3092,7 @@ */ _quote: function (str) { - return '"' + str.replace(/\\/g, "\\\\").replace(/"/g, '\\"') + '"'; + return '"' + str.replace(/\\/g, "\\\\").replace(/"/g, '\\"') + '"'; //" end string workaround for emacs }, diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_tcpproxy/web/xmpp.io.js --- a/mod_tcpproxy/web/xmpp.io.js Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_tcpproxy/web/xmpp.io.js Tue Mar 11 18:44:01 2014 +0100 @@ -6,7 +6,7 @@ this.xmppconn = xmppconn; this.xmpphost = xmpptcp_host; this.sid = "FIXME"; - + this.listeners = []; return this; } diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_turncredentials/mod_turncredentials.lua --- a/mod_turncredentials/mod_turncredentials.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_turncredentials/mod_turncredentials.lua Tue Mar 11 18:44:01 2014 +0100 @@ -1,6 +1,6 @@ -- XEP-0215 implementation for time-limited turn credentials -- Copyright (C) 2012-2013 Philipp Hancke --- This file is MIT/X11 licensed. +-- This file is MIT/X11 licensed. local st = require "util.stanza"; local hmac_sha1 = require "util.hashes".hmac_sha1; diff -r 0ae065453dc9 -r 7dbde05b48a9 mod_vjud/vcard.lib.lua --- a/mod_vjud/vcard.lib.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_vjud/vcard.lib.lua Tue Mar 11 18:44:01 2014 +0100 @@ -1,5 +1,5 @@ -- Copyright (C) 2011-2012 Kim Alvefur --- +-- -- This project is MIT/X11 licensed. Please see the -- COPYING file in the source package for more information. -- @@ -255,7 +255,7 @@ end end end - + if prop_def.props_verbatim then for k,v in pairs(prop_def.props_verbatim) do prop[k] = v; @@ -342,12 +342,12 @@ ADR = { types = { "HOME", - "WORK", - "POSTAL", - "PARCEL", + "WORK", + "POSTAL", + "PARCEL", "DOM", "INTL", - "PREF", + "PREF", }, values = { "POBOX", @@ -361,41 +361,41 @@ }, LABEL = { types = { - "HOME", - "WORK", - "POSTAL", - "PARCEL", + "HOME", + "WORK", + "POSTAL", + "PARCEL", "DOM", - "INTL", - "PREF", + "INTL", + "PREF", }, value = "LINE", }, TEL = { types = { - "HOME", - "WORK", - "VOICE", - "FAX", - "PAGER", - "MSG", - "CELL", - "VIDEO", - "BBS", - "MODEM", - "ISDN", - "PCS", - "PREF", + "HOME", + "WORK", + "VOICE", + "FAX", + "PAGER", + "MSG", + "CELL", + "VIDEO", + "BBS", + "MODEM", + "ISDN", + "PCS", + "PREF", }, value = "NUMBER", }, EMAIL = { types = { - "HOME", - "WORK", - "INTERNET", - "PREF", - "X400", + "HOME", + "WORK", + "INTERNET", + "PREF", + "X400", }, value = "USERID", },