Remove all trailing whitespace
authorFlorian Zeitz <florob@babelmonkeys.de>
Fri, 9 Aug 2013 15:48:21 +0000 (17:48 +0200)
committerFlorian Zeitz <florob@babelmonkeys.de>
Fri, 9 Aug 2013 15:48:21 +0000 (17:48 +0200)
116 files changed:
core/certmanager.lua
core/configmanager.lua
core/hostmanager.lua
core/loggingmanager.lua
core/moduleapi.lua
core/modulemanager.lua
core/portmanager.lua
core/rostermanager.lua
core/s2smanager.lua
core/sessionmanager.lua
core/stanza_router.lua
core/storagemanager.lua
core/usermanager.lua
fallbacks/bit.lua
fallbacks/lxp.lua
net/adns.lua
net/dns.lua
net/http.lua
net/http/server.lua
net/server.lua
net/server_event.lua
net/server_select.lua
plugins/mod_admin_telnet.lua
plugins/mod_announce.lua
plugins/mod_auth_internal_hashed.lua
plugins/mod_auth_internal_plain.lua
plugins/mod_bosh.lua
plugins/mod_c2s.lua
plugins/mod_component.lua
plugins/mod_compression.lua
plugins/mod_dialback.lua
plugins/mod_disco.lua
plugins/mod_groups.lua
plugins/mod_http.lua
plugins/mod_http_errors.lua
plugins/mod_http_files.lua
plugins/mod_iq.lua
plugins/mod_lastactivity.lua
plugins/mod_legacyauth.lua
plugins/mod_message.lua
plugins/mod_motd.lua
plugins/mod_offline.lua
plugins/mod_pep.lua
plugins/mod_ping.lua
plugins/mod_posix.lua
plugins/mod_presence.lua
plugins/mod_privacy.lua
plugins/mod_private.lua
plugins/mod_proxy65.lua
plugins/mod_register.lua
plugins/mod_roster.lua
plugins/mod_s2s/mod_s2s.lua
plugins/mod_s2s/s2sout.lib.lua
plugins/mod_saslauth.lua
plugins/mod_storage_sql.lua
plugins/mod_storage_sql2.lua
plugins/mod_time.lua
plugins/mod_tls.lua
plugins/mod_uptime.lua
plugins/mod_vcard.lua
plugins/mod_version.lua
plugins/mod_watchregistrations.lua
plugins/mod_welcome.lua
plugins/muc/mod_muc.lua
plugins/muc/muc.lib.lua
tests/modulemanager_option_conversion.lua
tests/test.lua
tests/test_core_configmanager.lua
tests/test_core_s2smanager.lua
tests/test_core_stanza_router.lua
tests/test_sasl.lua
tests/test_util_http.lua
tests/test_util_ip.lua
tests/test_util_jid.lua
tests/test_util_multitable.lua
tests/test_util_stanza.lua
tests/util/logger.lua
tools/ejabberd2prosody.lua
tools/ejabberdsql2prosody.lua
tools/erlparse.lua
tools/jabberd14sql2prosody.lua
tools/migration/migrator/prosody_sql.lua
tools/migration/prosody-migrator.lua
tools/openfire2prosody.lua
tools/xep227toprosody.lua
util/array.lua
util/caps.lua
util/dataforms.lua
util/datetime.lua
util/debug.lua
util/dependencies.lua
util/events.lua
util/filters.lua
util/helpers.lua
util/hmac.lua
util/import.lua
util/ip.lua
util/iterators.lua
util/jid.lua
util/json.lua
util/logger.lua
util/multitable.lua
util/pluginloader.lua
util/prosodyctl.lua
util/pubsub.lua
util/sasl/scram.lua
util/sasl_cyrus.lua
util/serialization.lua
util/set.lua
util/sql.lua
util/stanza.lua
util/termcolours.lua
util/timer.lua
util/uuid.lua
util/xml.lua
util/xmppstream.lua

index dc08cb78456e7a246d0e8fa6f072b72a8c739890..b39f4ed4f0c81ca70d20996bcc5cb4e084835dbb 100644 (file)
@@ -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.
 --
index 9720f48ac1156ed243b3d324f1cb968273c12ce9..71f60c81952f32260b483ece8951255ee4c47123 100644 (file)
@@ -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.
 --
@@ -73,7 +73,7 @@ do
                        -- Some normalization
                        parent_path = parent_path:gsub("%"..path_sep.."+$", "");
                        path = path:gsub("^%.%"..path_sep.."+", "");
-                       
+
                        local is_relative;
                        if path_sep == "/" and path:sub(1,1) ~= "/" then
                                is_relative = true;
@@ -85,7 +85,7 @@ do
                        end
                end
                return path;
-       end     
+       end
 end
 
 -- Helper function to convert a glob to a Lua pattern
@@ -167,7 +167,7 @@ do
                                        set(config, env.__currenthost or "*", k, v);
                                end
                });
-               
+
                rawset(env, "__currenthost", "*") -- Default is global
                function env.VirtualHost(name)
                        if rawget(config, name) and rawget(config[name], "component_module") then
@@ -185,7 +185,7 @@ do
                        end;
                end
                env.Host, env.host = env.VirtualHost, env.VirtualHost;
-               
+
                function env.Component(name)
                        if rawget(config, name) and rawget(config[name], "defined") and not rawget(config[name], "component_module") then
                                error(format("Component %q clashes with previously defined Host %q, for services use a sub-domain like conference.%s",
@@ -201,7 +201,7 @@ do
                                        set(config, name or "*", option_name, option_value);
                                end
                        end
-       
+
                        return function (module)
                                        if type(module) == "string" then
                                                set(config, name, "component_module", module);
@@ -211,7 +211,7 @@ do
                                end
                end
                env.component = env.Component;
-               
+
                function env.Include(file)
                        if file:match("[*?]") then
                                local path_pos, glob = file:match("()([^"..path_sep.."]+)$");
@@ -240,26 +240,26 @@ do
                        end
                end
                env.include = env.Include;
-               
+
                function env.RunScript(file)
                        return dofile(resolve_relative_path(config_file:gsub("[^"..path_sep.."]+$", ""), file));
                end
-               
+
                local chunk, err = envload(data, "@"..config_file, env);
-               
+
                if not chunk then
                        return nil, err;
                end
-               
+
                local ok, err = pcall(chunk);
-               
+
                if not ok then
                        return nil, err;
                end
-               
+
                return true;
        end
-       
+
 end
 
 return _M;
index 06ba72a100c5d3ebdf73fa80bf14707a7b065703..91b052d1725b303e5f69a1f7a57fa36ac76c4769 100644 (file)
@@ -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.
 --
@@ -35,7 +35,7 @@ local hosts_loaded_once;
 local function load_enabled_hosts(config)
        local defined_hosts = config or configmanager.getconfig();
        local activated_any_host;
-       
+
        for host, host_config in pairs(defined_hosts) do
                if host ~= "*" and host_config.enabled ~= false then
                        if not host_config.component_module then
@@ -44,11 +44,11 @@ local function load_enabled_hosts(config)
                        activate(host, host_config);
                end
        end
-       
+
        if not activated_any_host then
                log("error", "No active VirtualHost entries in the config file. This may cause unexpected behaviour as no modules will be loaded.");
        end
-       
+
        prosody_events.fire_event("hosts-activated", defined_hosts);
        hosts_loaded_once = true;
 end
@@ -93,7 +93,7 @@ function activate(host, host_config)
                        log("warn", "%s: Option '%s' has no effect for virtual hosts - put it in the server-wide section instead", host, option_name);
                end
        end
-       
+
        log((hosts_loaded_once and "info") or "debug", "Activated host: %s", host);
        prosody_events.fire_event("host-activated", host);
        return true;
@@ -104,11 +104,11 @@ function deactivate(host, reason)
        if not host_session then return nil, "The host "..tostring(host).." is not activated"; end
        log("info", "Deactivating host: %s", host);
        prosody_events.fire_event("host-deactivating", { host = host, host_session = host_session, reason = reason });
-       
+
        if type(reason) ~= "table" then
                reason = { condition = "host-gone", text = tostring(reason or "This server has stopped serving "..host) };
        end
-       
+
        -- Disconnect local users, s2s connections
        -- TODO: These should move to mod_c2s and mod_s2s (how do they know they're being unloaded and not reloaded?)
        if host_session.sessions then
index c69dede85edf747d4c5f935f99fea5b06887d72a..c63611468ba2fa2343567759ffb779e5d9220831 100644 (file)
@@ -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.
 --
@@ -48,7 +48,7 @@ local function add_rule(sink_config)
        if sink_maker then
                -- Create sink
                local sink = sink_maker(sink_config);
-               
+
                -- Set sink for all chosen levels
                for level in pairs(get_levels(sink_config.levels or logging_levels)) do
                        logger.add_level_sink(level, sink);
@@ -63,7 +63,7 @@ end
 -- the log_sink_types table.
 function apply_sink_rules(sink_type)
        if type(logging_config) == "table" then
-               
+
                for _, level in ipairs(logging_levels) do
                        if type(logging_config[level]) == "string" then
                                local value = logging_config[level];
@@ -82,7 +82,7 @@ function apply_sink_rules(sink_type)
                                end
                        end
                end
-               
+
                for _, sink_config in ipairs(logging_config) do
                        if (type(sink_config) == "table" and sink_config.to == sink_type) then
                                add_rule(sink_config);
@@ -128,7 +128,7 @@ function get_levels(criteria, set)
                        end
                end
        end
-       
+
        for _, level in ipairs(criteria) do
                set[level] = true;
        end
@@ -138,12 +138,12 @@ end
 -- Initialize config, etc. --
 function reload_logging()
        local old_sink_types = {};
-       
+
        for name, sink_maker in pairs(log_sink_types) do
                old_sink_types[name] = sink_maker;
                log_sink_types[name] = nil;
        end
-       
+
        logger.reset();
 
        local debug_mode = config.get("*", "debug");
@@ -155,12 +155,12 @@ function reload_logging()
        default_timestamp = "%b %d %H:%M:%S";
 
        logging_config = config.get("*", "log") or default_logging;
-       
-       
+
+
        for name, sink_maker in pairs(old_sink_types) do
                log_sink_types[name] = sink_maker;
        end
-       
+
        prosody.events.fire_event("logging-reloaded");
 end
 
@@ -179,11 +179,11 @@ local sourcewidth = 20;
 
 function log_sink_types.stdout(config)
        local timestamps = config.timestamps;
-       
+
        if timestamps == true then
                timestamps = default_timestamp; -- Default format
        end
-       
+
        return function (name, level, message, ...)
                sourcewidth = math_max(#name+2, sourcewidth);
                local namelen = #name;
@@ -200,7 +200,7 @@ end
 
 do
        local do_pretty_printing = true;
-       
+
        local logstyles = {};
        if do_pretty_printing then
                logstyles["info"] = getstyle("bold");
@@ -212,7 +212,7 @@ do
                if not do_pretty_printing then
                        return log_sink_types.stdout(config);
                end
-               
+
                local timestamps = config.timestamps;
 
                if timestamps == true then
@@ -222,7 +222,7 @@ do
                return function (name, level, message, ...)
                        sourcewidth = math_max(#name+2, sourcewidth);
                        local namelen = #name;
-                       
+
                        if timestamps then
                                io_write(os_date(timestamps), " ");
                        end
index a4ba9bc8f9015498558700419b16e9738ea54f07..6e85753153c6e48c1508ef175e9a9f35937188d9 100644 (file)
@@ -1,7 +1,7 @@
 -- Prosody IM
 -- Copyright (C) 2008-2012 Matthew Wild
 -- Copyright (C) 2008-2012 Waqas Hussain
--- 
+--
 -- This project is MIT/X11 licensed. Please see the
 -- COPYING file in the source package for more information.
 --
@@ -74,7 +74,7 @@ end
 function api:has_identity(category, type, name)
        for _, id in ipairs(self:get_host_items("identity")) do
                if id.category == category and id.type == type and id.name == name then
-                       return true; 
+                       return true;
                end
        end
        return false;
@@ -252,21 +252,21 @@ function api:get_option_array(name, ...)
        if value == nil then
                return nil;
        end
-       
+
        if type(value) ~= "table" then
                return array{ value }; -- Assume any non-list is a single-item list
        end
-       
+
        return array():append(value); -- Clone
 end
 
 function api:get_option_set(name, ...)
        local value = self:get_option_array(name, ...);
-       
+
        if value == nil then
                return nil;
        end
-       
+
        return set.new(value);
 end
 
index 535c227b13e908d25ad9346c78c7f63c9ac0c85a..2ad2fc1761f44d822e5879ae1755d2c7ab917dc8 100644 (file)
@@ -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.
 --
@@ -45,28 +45,28 @@ local modulemap = { ["*"] = {} };
 -- Load modules when a host is activated
 function load_modules_for_host(host)
        local component = config.get(host, "component_module");
-       
+
        local global_modules_enabled = config.get("*", "modules_enabled");
        local global_modules_disabled = config.get("*", "modules_disabled");
        local host_modules_enabled = config.get(host, "modules_enabled");
        local host_modules_disabled = config.get(host, "modules_disabled");
-       
+
        if host_modules_enabled == global_modules_enabled then host_modules_enabled = nil; end
        if host_modules_disabled == global_modules_disabled then host_modules_disabled = nil; end
-       
+
        local global_modules = set.new(autoload_modules) + set.new(global_modules_enabled) - set.new(global_modules_disabled);
        if component then
                global_modules = set.intersection(set.new(component_inheritable_modules), global_modules);
        end
        local modules = (global_modules + set.new(host_modules_enabled)) - set.new(host_modules_disabled);
-       
+
        -- COMPAT w/ pre 0.8
        if modules:contains("console") then
                log("error", "The mod_console plugin has been renamed to mod_admin_telnet. Please update your config.");
                modules:remove("console");
                modules:add("admin_telnet");
        end
-       
+
        if component then
                load(host, component);
        end
@@ -84,18 +84,18 @@ end);
 local function do_unload_module(host, name)
        local mod = get_module(host, name);
        if not mod then return nil, "module-not-loaded"; end
-       
+
        if module_has_method(mod, "unload") then
                local ok, err = call_module_method(mod, "unload");
                if (not ok) and err then
                        log("warn", "Non-fatal error unloading module '%s' on '%s': %s", name, host, err);
                end
        end
-       
+
        for object, event, handler in mod.module.event_handlers:iter(nil, nil, nil) do
                object.remove_handler(event, handler);
        end
-       
+
        if mod.module.items then -- remove items
                local events = (host == "*" and prosody.events) or hosts[host].events;
                for key,t in pairs(mod.module.items) do
@@ -117,11 +117,11 @@ local function do_load_module(host, module_name, state)
        elseif not hosts[host] and host ~= "*"then
                return nil, "unknown-host";
        end
-       
+
        if not modulemap[host] then
                modulemap[host] = hosts[host].modules;
        end
-       
+
        if modulemap[host][module_name] then
                log("warn", "%s is already loaded for %s, so not loading again", module_name, host);
                return nil, "module-already-loaded";
@@ -147,7 +147,7 @@ local function do_load_module(host, module_name, state)
                end
                return nil, "global-module-already-loaded";
        end
-       
+
 
 
        local _log = logger.init(host..":"..module_name);
@@ -158,7 +158,7 @@ local function do_load_module(host, module_name, state)
 
        local pluginenv = setmetatable({ module = api_instance }, { __index = _G });
        api_instance.environment = pluginenv;
-       
+
        local mod, err = pluginloader.load_code(module_name, nil, pluginenv);
        if not mod then
                log("error", "Unable to load module '%s': %s", module_name or "nil", err or "nil");
index 7a2474520ebbcbf4f58f3a43ca53fe04158cf0c6..95900c08483156f8f54f8fe2412e450c56e6b63b 100644 (file)
@@ -87,7 +87,7 @@ function activate(service_name)
        if not service_info then
                return nil, "Unknown service: "..service_name;
        end
-       
+
        local listener = service_info.listener;
 
        local config_prefix = (service_info.config_prefix or service_name).."_";
@@ -103,7 +103,7 @@ function activate(service_name)
                or listener.default_interface -- COMPAT w/pre0.9
                or default_interfaces
        bind_interfaces = set.new(type(bind_interfaces)~="table" and {bind_interfaces} or bind_interfaces);
-       
+
        local bind_ports = config.get("*", config_prefix.."ports")
                or service_info.default_ports
                or {service_info.default_port
@@ -113,7 +113,7 @@ function activate(service_name)
 
        local mode, ssl = listener.default_mode or "*a";
        local hooked_ports = {};
-       
+
        for interface in bind_interfaces do
                for port in bind_ports do
                        local port_number = tonumber(port);
@@ -188,7 +188,7 @@ function register_service(service_name, service_info)
                        log("error", "Failed to activate service '%s': %s", service_name, err or "unknown error");
                end
        end
-       
+
        fire_event("service-added", { name = service_name, service = service_info });
        return true;
 end
index 4c669eac38d26e60eee49a77e5a0809460faf92d..5266afb52679b5bbe7677df3180350de8bc847ce 100644 (file)
@@ -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.
 --
index 06d3f2c939d259358f9050fa86834fc67232bb24..59c1831b5eea054805283ea4c8339243523aa461 100644 (file)
@@ -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.
 --
@@ -70,14 +70,14 @@ end
 function destroy_session(session, reason)
        if session.destroyed then return; end
        (session.log or log)("debug", "Destroying "..tostring(session.direction).." session "..tostring(session.from_host).."->"..tostring(session.to_host)..(reason and (": "..reason) or ""));
-       
+
        if session.direction == "outgoing" then
                hosts[session.from_host].s2sout[session.to_host] = nil;
                session:bounce_sendq(reason);
        elseif session.direction == "incoming" then
                incoming_s2s[session] = nil;
        end
-       
+
        local event_data = { session = session, reason = reason };
        if session.type == "s2sout" then
                fire_event("s2sout-destroyed", event_data);
@@ -90,7 +90,7 @@ function destroy_session(session, reason)
                        hosts[session.to_host].events.fire_event("s2sin-destroyed", event_data);
                end
        end
-       
+
        retire_session(session, reason); -- Clean session until it is GC'd
        return true;
 end
index 98ead07fdb2dd50e2172403c6eeec8742db4be0f..5f7f688eb90ce61e712b5b0c2074f03df3370529 100644 (file)
@@ -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.
 --
@@ -44,7 +44,7 @@ function new_session(conn)
        session.ip = conn:ip();
        local conn_name = "c2s"..tostring(session):match("[a-f0-9]+$");
        session.log = logger.init(conn_name);
-               
+
        return session;
 end
 
@@ -73,19 +73,19 @@ end
 function destroy_session(session, err)
        (session.log or log)("debug", "Destroying session for %s (%s@%s)%s", session.full_jid or "(unknown)", session.username or "(unknown)", session.host or "(unknown)", err and (": "..err) or "");
        if session.destroyed then return; end
-       
+
        -- Remove session/resource from user's session list
        if session.full_jid then
                local host_session = hosts[session.host];
-               
+
                -- Allow plugins to prevent session destruction
                if host_session.events.fire_event("pre-resource-unbind", {session=session, error=err}) then
                        return;
                end
-               
+
                host_session.sessions[session.username].sessions[session.resource] = nil;
                full_sessions[session.full_jid] = nil;
-               
+
                if not next(host_session.sessions[session.username].sessions) then
                        log("debug", "All resources of %s are now offline", session.username);
                        host_session.sessions[session.username] = nil;
@@ -94,7 +94,7 @@ function destroy_session(session, err)
 
                host_session.events.fire_event("resource-unbind", {session=session, error=err});
        end
-       
+
        retire_session(session);
 end
 
@@ -119,7 +119,7 @@ function bind_resource(session, resource)
        resource = resourceprep(resource);
        resource = resource ~= "" and resource or uuid_generate();
        --FIXME: Randomly-generated resources must be unique per-user, and never conflict with existing
-       
+
        if not hosts[session.host].sessions[session.username] then
                local sessions = { sessions = {} };
                hosts[session.host].sessions[session.username] = sessions;
@@ -156,12 +156,12 @@ function bind_resource(session, resource)
                        end
                end
        end
-       
+
        session.resource = resource;
        session.full_jid = session.username .. '@' .. session.host .. '/' .. resource;
        hosts[session.host].sessions[session.username].sessions[resource] = session;
        full_sessions[session.full_jid] = session;
-       
+
        local err;
        session.roster, err = rm_load_roster(session.username, session.host);
        if err then
@@ -176,9 +176,9 @@ function bind_resource(session, resource)
                session.log("error", "Roster loading failed: %s", err);
                return nil, "cancel", "internal-server-error", "Error loading roster";
        end
-       
+
        hosts[session.host].events.fire_event("resource-bind", {session=session});
-       
+
        return true;
 end
 
index 94753678b918facec4d70a5ec14822c4effc4225..c78a657af48051591165100f07f9cbe696f93f9d 100644 (file)
@@ -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.
 --
@@ -196,7 +196,7 @@ function core_route_stanza(origin, stanza)
        -- Auto-detect origin if not specified
        origin = origin or hosts[from_host];
        if not origin then return false; end
-       
+
        if hosts[host] then
                -- old stanza routing code removed
                core_post_stanza(origin, stanza);
index 1c82af6d8b2fdf9934d89e41a68e9fd536974c39..5674ff32cdf2dc9501980e4d3543a462eb085c44 100644 (file)
@@ -37,7 +37,7 @@ function initialize_host(host)
                local item = event.item;
                stores_available:set(host, item.name, item);
        end);
-       
+
        host_session.events.add_handler("item-removed/storage-provider", function (event)
                local item = event.item;
                stores_available:set(host, item.name, nil);
@@ -70,7 +70,7 @@ function get_driver(host, store)
        if not driver_name then
                driver_name = config.get(host, "default_storage") or "internal";
        end
-       
+
        local driver = load_driver(host, driver_name);
        if not driver then
                log("warn", "Falling back to null driver for %s storage on %s", store, host);
index 08343bee3c580233e45ab4ccb4eb87fd61f3e577..886bd5cbd4807d712b7e8dad7888a89f0c38c299 100644 (file)
@@ -39,7 +39,7 @@ local provider_mt = { __index = new_null_provider() };
 function initialize_host(host)
        local host_session = hosts[host];
        if host_session.type ~= "local" then return; end
-       
+
        host_session.events.add_handler("item-added/auth-provider", function (event)
                local provider = event.item;
                local auth_provider = config.get(host, "authentication") or default_provider;
@@ -115,10 +115,10 @@ function is_admin(jid, host)
        local is_admin;
        jid = jid_bare(jid);
        host = host or "*";
-       
+
        local host_admins = config.get(host, "admins");
        local global_admins = config.get("*", "admins");
-       
+
        if host_admins and host_admins ~= global_admins then
                if type(host_admins) == "table" then
                        for _,admin in ipairs(host_admins) do
@@ -131,7 +131,7 @@ function is_admin(jid, host)
                        log("error", "Option 'admins' for host '%s' is not a list", host);
                end
        end
-       
+
        if not is_admin and global_admins then
                if type(global_admins) == "table" then
                        for _,admin in ipairs(global_admins) do
@@ -144,7 +144,7 @@ function is_admin(jid, host)
                        log("error", "Global option 'admins' is not a list");
                end
        end
-       
+
        -- Still not an admin, check with auth provider
        if not is_admin and host ~= "*" and hosts[host].users and hosts[host].users.is_admin then
                is_admin = hosts[host].users.is_admin(jid);
index 2482c473e8cab4f7fd0b6a58dc0e2bd0d0d518e8..28dca4e6a0f5e15f4bc876048aace1110679bc76 100644 (file)
@@ -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.
 --
index 6d3297d1559983b19e0da7edc76ac594b26734ce..ac1c9a03d2ba6889be98b303b9fc9700d7f9770a 100644 (file)
@@ -61,7 +61,7 @@ local function parser(data, handlers, ns_separator)
                while #data == 0 do data = coroutine.yield(); end
                return data:sub(1,1);
        end
-       
+
        local ns = { xml = "http://www.w3.org/XML/1998/namespace" };
        ns.__index = ns;
        local function apply_ns(name, dodefault)
@@ -100,7 +100,7 @@ local function parser(data, handlers, ns_separator)
                ns = getmetatable(ns);
                return tag;
        end
-       
+
        while true do
                if peek() == "<" then
                        local elem = read_until(">"):sub(2,-2);
index 158747c68746d3312fe48876391a35a319b9b06c..08421f77c579dd8f3e51253ad3fe96194cc33d63 100644 (file)
@@ -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.
 --
@@ -64,7 +64,7 @@ function new_async_socket(sock, resolver)
                        if resolver.socketset[conn] == resolver.best_server and resolver.best_server == #servers then
                                log("error", "Exhausted all %d configured DNS servers, next lookup will try %s again", #servers, servers[1]);
                        end
-               
+
                        resolver:servfail(conn); -- Let the magic commence
                end
        end
@@ -72,7 +72,7 @@ function new_async_socket(sock, resolver)
        if not handler then
                return nil, err;
        end
-       
+
        handler.settimeout = function () end
        handler.setsockname = function (_, ...) return sock:setsockname(...); end
        handler.setpeername = function (_, ...) peername = (...); local ret = sock:setpeername(...); _:set_send(dummy_send); return ret; end
index 95f09cc995d48d78db87c175ec5bf9937f0661af..bd5c260ec2f1a638843c662544139e1b2eb6e920 100644 (file)
@@ -753,7 +753,7 @@ function resolver:query(qname, qtype, qclass)    -- - - - - - - - - - -- query
                return nil, err;
        end
        conn:send (o.packet)
-       
+
        if timer and self.timeout then
                local num_servers = #self.server;
                local i = 1;
@@ -849,7 +849,7 @@ function resolver:receive(rset)    -- - - - - - - - - - - - - - - - -  receive
                                        -- retire the query
                                        local queries = self.active[response.header.id];
                                        queries[response.question.raw] = nil;
-                                       
+
                                        if not next(queries) then self.active[response.header.id] = nil; end
                                        if not next(self.active) then self:closeall(); end
 
@@ -864,7 +864,7 @@ function resolver:receive(rset)    -- - - - - - - - - - - - - - - - -  receive
                                                set(self.wanted, q.class, q.type, q.name, nil);
                                        end
                                end
-                               
+
                        end
                end
        end
index b7d2beb99417949c425c26133f13d64e76f23b95..5ec3163c06644269a1211e7ff2fdf3c2d796b92c 100644 (file)
@@ -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.
 --
@@ -36,7 +36,7 @@ function listener.onconnect(conn)
        if req.query then
                t_insert(request_line, 4, "?"..req.query);
        end
-       
+
        conn:write(t_concat(request_line));
        local t = { [2] = ": ", [4] = "\r\n" };
        for k, v in pairs(req.headers) do
@@ -44,7 +44,7 @@ function listener.onconnect(conn)
                conn:write(t_concat(t));
        end
        conn:write("\r\n");
-       
+
        if req.body then
                conn:write(req.body);
        end
@@ -80,12 +80,12 @@ local function request_reader(request, data, err)
                        end
                        destroy_request(request);
                end
-               
+
                if not data then
                        error_cb(err);
                        return;
                end
-               
+
                local function success_cb(r)
                        if request.callback then
                                request.callback(r.body, r.code, r, request);
@@ -104,18 +104,18 @@ end
 local function handleerr(err) log("error", "Traceback[http]: %s", traceback(tostring(err), 2)); end
 function request(u, ex, callback)
        local req = url.parse(u);
-       
+
        if not (req and req.host) then
                callback(nil, 0, req);
                return nil, "invalid-url";
        end
-       
+
        if not req.path then
                req.path = "/";
        end
-       
+
        local method, headers, body;
-       
+
        local host, port = req.host, req.port;
        local host_header = host;
        if (port == "80" and req.scheme == "http")
@@ -129,7 +129,7 @@ function request(u, ex, callback)
                ["Host"] = host_header;
                ["User-Agent"] = "Prosody XMPP Server";
        };
-       
+
        if req.userinfo then
                headers["Authorization"] = "Basic "..b64(req.userinfo);
        end
@@ -149,16 +149,16 @@ function request(u, ex, callback)
                        end
                end
        end
-       
+
        -- Attach to request object
        req.method, req.headers, req.body = method, headers, body;
-       
+
        local using_https = req.scheme == "https";
        if using_https and not ssl_available then
                error("SSL not available, unable to contact https URL");
        end
        local port_number = port and tonumber(port) or (using_https and 443 or 80);
-       
+
        -- Connect the socket, and wrap it with net.server
        local conn = socket.tcp();
        conn:settimeout(10);
@@ -167,7 +167,7 @@ function request(u, ex, callback)
                callback(nil, 0, req);
                return nil, err;
        end
-       
+
        local sslctx = false;
        if using_https then
                sslctx = ex and ex.sslctx or { mode = "client", protocol = "sslv23", options = { "no_sslv2" } };
@@ -175,7 +175,7 @@ function request(u, ex, callback)
 
        req.handler, req.conn = server.wrapclient(conn, host, port_number, listener, "*a", sslctx);
        req.write = function (...) return req.handler:write(...); end
-       
+
        req.callback = function (content, code, request, response) log("debug", "Calling callback, status %s", code or "---"); return select(2, xpcall(function () return callback(content, code, request, response) end, handleerr)); end
        req.reader = request_reader;
        req.state = "status";
index 0f379e96c625e726f554184e8735decb879a7d6b..5961169fd3a42e58753fc371062acc950b9945bc 100644 (file)
@@ -204,7 +204,7 @@ function handle_request(conn, request, finish_cb)
                        err_code, err = 400, "Missing or invalid 'Host' header";
                end
        end
-       
+
        if err then
                response.status_code = err_code;
                response:send(events.fire_event("http-error", { code = err_code, message = err }));
@@ -250,7 +250,7 @@ function _M.send_response(response, body)
        if response.finished then return; end
        response.finished = true;
        response.conn._http_open_response = nil;
-       
+
        local status_line = "HTTP/"..response.request.httpversion.." "..(response.status or codes[response.status_code]);
        local headers = response.headers;
        body = body or response.body or "";
index 375e7081f670bb760f46fe8df757215a34e9617d..2a0b89ae8aa60b68228d0b4c2657fd14f3e2e524 100644 (file)
@@ -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.
 --
index 9f479d5be6e95576c1c6acd57eea8cf5e2044441..59217a0cf33d449ed0002423105900649bc6bc09 100644 (file)
@@ -115,10 +115,10 @@ end )( )
 local interface_mt
 do
        interface_mt = {}; interface_mt.__index = interface_mt;
-       
+
        local addevent = base.addevent
        local coroutine_wrap, coroutine_yield = coroutine.wrap,coroutine.yield
-       
+
        -- Private methods
        function interface_mt:_position(new_position)
                        self.position = new_position or self.position
@@ -127,7 +127,7 @@ do
        function interface_mt:_close()
                return self:_destroy();
        end
-       
+
        function interface_mt:_start_connection(plainssl) -- should be called from addclient
                        local callback = function( event )
                                if EV_TIMEOUT == event then  -- timeout during connection
@@ -268,12 +268,12 @@ do
                        interfacelist( "delete", self )
                        return true
        end
-       
+
        function interface_mt:_lock(nointerface, noreading, nowriting)  -- lock or unlock this interface or events
                        self.nointerface, self.noreading, self.nowriting = nointerface, noreading, nowriting
                        return nointerface, noreading, nowriting
        end
-       
+
        --TODO: Deprecate
        function interface_mt:lock_read(switch)
                if switch then
@@ -300,7 +300,7 @@ do
                end
                return self._connections
        end
-       
+
        -- Public methods
        function interface_mt:write(data)
                if self.nowriting then return nil, "locked" end
@@ -343,27 +343,27 @@ do
                        return true
                end
        end
-       
+
        function interface_mt:socket()
                return self.conn
        end
-       
+
        function interface_mt:server()
                return self._server or self;
        end
-       
+
        function interface_mt:port()
                return self._port
        end
-       
+
        function interface_mt:serverport()
                return self._serverport
        end
-       
+
        function interface_mt:ip()
                return self._ip
        end
-       
+
        function interface_mt:ssl()
                return self._usingssl
        end
@@ -371,15 +371,15 @@ do
        function interface_mt:type()
                return self._type or "client"
        end
-       
+
        function interface_mt:connections()
                return self._connections
        end
-       
+
        function interface_mt:address()
                return self.addr
        end
-       
+
        function interface_mt:set_sslctx(sslctx)
                self._sslctx = sslctx;
                if sslctx then
@@ -395,11 +395,11 @@ do
                end
                return self._pattern;
        end
-       
+
        function interface_mt:set_send(new_send)
                -- No-op, we always use the underlying connection's send
        end
-       
+
        function interface_mt:starttls(sslctx, call_onconnect)
                debug( "try to start ssl at client id:", self.id )
                local err
@@ -428,14 +428,14 @@ do
                self.starttls = false;
                return true
        end
-       
+
        function interface_mt:setoption(option, value)
                if self.conn.setoption then
                        return self.conn:setoption(option, value);
                end
                return false, "setoption not implemented";
        end
-       
+
        function interface_mt:setlistener(listener)
                self.onconnect, self.ondisconnect, self.onincoming, self.ontimeout, self.onreadtimeout, self.onstatus
                        = listener.onconnect, listener.ondisconnect, listener.onincoming,
@@ -499,7 +499,7 @@ do
                        noreading = false, nowriting = false;  -- locks of the read/writecallback
                        startsslcallback = false;  -- starting handshake callback
                        position = false;  -- position of client in interfacelist
-                       
+
                        -- Properties
                        _ip = ip, _port = port, _server = server, _pattern = pattern,
                        _serverport = (server and server:port() or nil),
@@ -575,7 +575,7 @@ do
                                end
                        end
                end
-               
+
                interface.readcallback = function( event )  -- called on read events
                        --vdebug( "new client read event, id/ip/port:", tostring(interface.id), tostring(ip), tostring(port) )
                        if interface.noreading or interface.fatalerror then  -- leave this event
@@ -648,7 +648,7 @@ do
                debug "creating server interface..."
                local interface = {
                        _connections = 0;
-                       
+
                        conn = server;
                        onconnect = listener.onconnect;  -- will be called when new client connected
                        eventread = false;  -- read event handler
@@ -656,7 +656,7 @@ do
                        readcallback = false; -- read event callback
                        fatalerror = false; -- error message
                        nointerface = true;  -- lock/unlock parameter
-                       
+
                        _ip = addr, _port = port, _pattern = pattern,
                        _sslctx = sslctx;
                }
@@ -695,12 +695,12 @@ do
                                        clientinterface:_start_session( true )
                                end
                                debug( "accepted incoming client connection from:", client_ip or "<unknown IP>", client_port or "<unknown port>", "to", port or "<unknown port>");
-                               
+
                                client, err = server:accept()    -- try to accept again
                        end
                        return EV_READ
                end
-               
+
                server:settimeout( 0 )
                setmetatable(interface, interface_mt)
                interfacelist( "add", interface )
@@ -743,7 +743,7 @@ do
                return interface, client
                --function handleclient( client, ip, port, server, pattern, listener, _, sslctx )  -- creates an client interface
        end
-       
+
        function addclient( addr, serverport, listener, pattern, localaddr, localport, sslcfg, startssl )
                local client, err = socket.tcp()  -- creating new socket
                if not client then
@@ -834,14 +834,14 @@ end
 
 local function link(sender, receiver, buffersize)
        local sender_locked;
-       
+
        function receiver:ondrain()
                if sender_locked then
                        sender:resume();
                        sender_locked = nil;
                end
        end
-       
+
        function sender:onincoming(data)
                receiver:write(data);
                if receiver.writebufferlen >= buffersize then
index 98e9f8475cf8c932b90742dac26b01bd6054b3c2..7b550bf9dcd199f2cd543e18af211f4440a8ede1 100644 (file)
@@ -1,7 +1,7 @@
--- 
+--
 -- server.lua by blastbeat of the luadch project
 -- Re-used here under the MIT/X Consortium License
--- 
+--
 -- Modifications (C) 2008-2010 Matthew Wild, Waqas Hussain
 --
 
@@ -607,7 +607,7 @@ wrapconnection = function( server, listeners, socket, ip, serverport, clientport
                        shutdown = id
                        _socketlist[ socket ] = handler
                        _readlistlen = addsocket(_readlist, socket, _readlistlen)
-                       
+
                        -- remove traces of the old socket
                        _readlistlen = removesocket( _readlist, oldsocket, _readlistlen )
                        _sendlistlen = removesocket( _sendlist, oldsocket, _sendlistlen )
@@ -695,7 +695,7 @@ local function link(sender, receiver, buffersize)
                        sender_locked = nil;
                end
        end
-       
+
        local _readbuffer = sender.readbuffer;
        function sender.readbuffer()
                _readbuffer();
@@ -969,7 +969,7 @@ return {
 
        addclient = addclient,
        wrapclient = wrapclient,
-       
+
        loop = loop,
        link = link,
        step = step,
index 18ae4fe010779271524fafc8ca24d90a7321b57f..e13d27c24a9ac2c8019e26ad6956aa8854c63a47 100644 (file)
@@ -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.
 --
@@ -60,20 +60,20 @@ function console:new_session(conn)
                        disconnect = function () conn:close(); end;
                        };
        session.env = setmetatable({}, default_env_mt);
-       
+
        -- Load up environment with helper objects
        for name, t in pairs(def_env) do
                if type(t) == "table" then
                        session.env[name] = setmetatable({ session = session }, { __index = t });
                end
        end
-       
+
        return session;
 end
 
 function console:process_line(session, line)
        local useglobalenv;
-       
+
        if line:match("^>") then
                line = line:gsub("^>", "");
                useglobalenv = true;
@@ -87,9 +87,9 @@ function console:process_line(session, line)
                        return;
                end
        end
-       
+
        session.env._ = line;
-       
+
        local chunkname = "=console";
        local env = (useglobalenv and redirect_output(_G, session)) or session.env or nil
        local chunk, err = envload("return "..line, chunkname, env);
@@ -103,20 +103,20 @@ function console:process_line(session, line)
                        return;
                end
        end
-       
+
        local ranok, taskok, message = pcall(chunk);
-       
+
        if not (ranok or message or useglobalenv) and commands[line:lower()] then
                commands[line:lower()](session, line);
                return;
        end
-       
+
        if not ranok then
                session.print("Fatal error while running command, it did not complete");
                session.print("Error: "..taskok);
                return;
        end
-       
+
        if not message then
                session.print("Result: "..tostring(taskok));
                return;
@@ -125,7 +125,7 @@ function console:process_line(session, line)
                session.print("Message: "..tostring(message));
                return;
        end
-       
+
        session.print("OK: "..tostring(message));
 end
 
@@ -344,9 +344,9 @@ end
 
 function def_env.module:load(name, hosts, config)
        local mm = require "modulemanager";
-       
+
        hosts = get_hosts_set(hosts);
-       
+
        -- Load the module for each host
        local ok, err, count, mod = true, nil, 0, nil;
        for host in hosts do
@@ -367,15 +367,15 @@ function def_env.module:load(name, hosts, config)
                        end
                end
        end
-       
-       return ok, (ok and "Module loaded onto "..count.." host"..(count ~= 1 and "s" or "")) or ("Last error: "..tostring(err));       
+
+       return ok, (ok and "Module loaded onto "..count.." host"..(count ~= 1 and "s" or "")) or ("Last error: "..tostring(err));
 end
 
 function def_env.module:unload(name, hosts)
        local mm = require "modulemanager";
 
        hosts = get_hosts_set(hosts, name);
-       
+
        -- Unload the module for each host
        local ok, err, count = true, nil, 0;
        for host in hosts do
@@ -433,7 +433,7 @@ function def_env.module:list(hosts)
        if type(hosts) ~= "table" then
                return false, "Please supply a host or a list of hosts you would like to see";
        end
-       
+
        local print = self.session.print;
        for _, host in ipairs(hosts) do
                print((host == "*" and "Global" or host)..":");
@@ -520,7 +520,7 @@ function def_env.c2s:count(match_jid)
        show_c2s(function (jid, session)
                if (not match_jid) or jid:match(match_jid) then
                        count = count + 1;
-               end             
+               end
        end);
        return true, "Total: "..count.." clients";
 end
@@ -540,7 +540,7 @@ function def_env.c2s:show(match_jid)
                                status = session.presence:get_child_text("show") or "available";
                        end
                        print(session_flags(session, { "   "..jid.." - "..status.."("..priority..")" }));
-               end             
+               end
        end);
        return true, "Total: "..count.." clients";
 end
@@ -551,7 +551,7 @@ function def_env.c2s:show_insecure(match_jid)
                if ((not match_jid) or jid:match(match_jid)) and not session.secure then
                        count = count + 1;
                        print(jid);
-               end             
+               end
        end);
        return true, "Total: "..count.." insecure client connections";
 end
@@ -562,7 +562,7 @@ function def_env.c2s:show_secure(match_jid)
                if ((not match_jid) or jid:match(match_jid)) and session.secure then
                        count = count + 1;
                        print(jid);
-               end             
+               end
        end);
        return true, "Total: "..count.." secure client connections";
 end
@@ -582,10 +582,10 @@ end
 def_env.s2s = {};
 function def_env.s2s:show(match_jid)
        local print = self.session.print;
-       
+
        local count_in, count_out = 0,0;
        local s2s_list = { };
-       
+
        local s2s_sessions = module:shared"/*/s2s/sessions";
        for _, session in pairs(s2s_sessions) do
                local remotehost, localhost, direction;
@@ -724,18 +724,18 @@ function def_env.s2s:showcert(domain)
        local domain_certs = array.collect(values(cert_set));
        -- Phew. We now have a array of unique certificates presented by domain.
        local n_certs = #domain_certs;
-       
+
        if n_certs == 0 then
                return "No certificates found for "..domain;
        end
-       
+
        local function _capitalize_and_colon(byte)
                return string.upper(byte)..":";
        end
        local function pretty_fingerprint(hash)
                return hash:gsub("..", _capitalize_and_colon):sub(1, -2);
        end
-       
+
        for cert_info in values(domain_certs) do
                local certs = cert_info.certs;
                local cert = certs[1];
@@ -777,7 +777,7 @@ end
 function def_env.s2s:close(from, to)
        local print, count = self.session.print, 0;
        local s2s_sessions = module:shared"/*/s2s/sessions";
-       
+
        local match_id;
        if from and not to then
                match_id, from = from;
@@ -786,7 +786,7 @@ function def_env.s2s:close(from, to)
        elseif from == to then
                return false, "Both from and to are the same... you can't do that :)";
        end
-       
+
        for _, session in pairs(s2s_sessions) do
                local id = session.type..tostring(session):match("[a-f0-9]+$");
                if (match_id and match_id == id)
@@ -1031,12 +1031,12 @@ function printbanner(session)
        local option = module:get_option("console_banner");
        if option == nil or option == "full" or option == "graphic" then
                session.print [[
-                   ____                \   /     _       
-                    |  _ \ _ __ ___  ___  _-_   __| |_   _ 
+                   ____                \   /     _
+                    |  _ \ _ __ ___  ___  _-_   __| |_   _
                     | |_) | '__/ _ \/ __|/ _ \ / _` | | | |
                     |  __/| | | (_) \__ \ |_| | (_| | |_| |
                     |_|   |_|  \___/|___/\___/ \__,_|\__, |
-                    A study in simplicity            |___/ 
+                    A study in simplicity            |___/
 
 ]]
        end
index 96976d6f843df6ae51611fea541c846587ece9b3..9327556c5e1b8354dbf3680d07700a0aecee6807 100644 (file)
@@ -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.
 --
@@ -39,22 +39,22 @@ end
 function handle_announcement(event)
        local origin, stanza = event.origin, event.stanza;
        local node, host, resource = jid.split(stanza.attr.to);
-       
+
        if resource ~= "announce/online" then
                return; -- Not an announcement
        end
-       
+
        if not is_admin(stanza.attr.from) then
                -- Not an admin? Not allowed!
                module:log("warn", "Non-admin '%s' tried to send server announcement", stanza.attr.from);
                return;
        end
-       
+
        module:log("info", "Sending server announcement to all online users");
        local message = st.clone(stanza);
        message.attr.type = "headline";
        message.attr.from = host;
-       
+
        local c = send_to_online(message, host);
        module:log("info", "Announcement sent to %d online users", c);
        return true;
@@ -83,9 +83,9 @@ function announce_handler(self, data, state)
                module:log("info", "Sending server announcement to all online users");
                local message = st.message({type = "headline"}, fields.announcement):up()
                        :tag("subject"):text(fields.subject or "Announcement");
-               
+
                local count = send_to_online(message, data.to);
-               
+
                module:log("info", "Announcement sent to %d online users", count);
                return { status = "completed", info = ("Announcement sent to %d online users"):format(count) };
        else
index 2b041e432021283ce9aac727532afb6e95376421..573967318a604aacda7c43dddb00c5eaeb502e69 100644 (file)
@@ -62,12 +62,12 @@ function provider.test_password(username, password)
        if credentials.iteration_count == nil or credentials.salt == nil or string.len(credentials.salt) == 0 then
                return nil, "Auth failed. Stored salt and iteration count information is not complete.";
        end
-       
+
        local valid, stored_key, server_key = getAuthenticationDatabaseSHA1(password, credentials.salt, credentials.iteration_count);
-       
+
        local stored_key_hex = to_hex(stored_key);
        local server_key_hex = to_hex(server_key);
-       
+
        if valid and stored_key_hex == credentials.stored_key and server_key_hex == credentials.server_key then
                return true;
        else
@@ -83,7 +83,7 @@ function provider.set_password(username, password)
                local valid, stored_key, server_key = getAuthenticationDatabaseSHA1(password, account.salt, account.iteration_count);
                local stored_key_hex = to_hex(stored_key);
                local server_key_hex = to_hex(server_key);
-               
+
                account.stored_key = stored_key_hex
                account.server_key = server_key_hex
 
@@ -134,7 +134,7 @@ function provider.get_sasl_handler()
                                credentials = accounts:get(username);
                                if not credentials then return; end
                        end
-                       
+
                        local stored_key, server_key, iteration_count, salt = credentials.stored_key, credentials.server_key, credentials.iteration_count, credentials.salt;
                        stored_key = stored_key and from_hex(stored_key);
                        server_key = server_key and from_hex(server_key);
@@ -143,6 +143,6 @@ function provider.get_sasl_handler()
        };
        return new_sasl(host, testpass_authentication_profile);
 end
-       
+
 module:provides("auth", provider);
 
index d226fdbefa5cb2adbd6ef443457751941f5272c7..4d698fa069c794ad498aa604bae9316de9db8756 100644 (file)
@@ -76,6 +76,6 @@ function provider.get_sasl_handler()
        };
        return new_sasl(host, getpass_authentication_profile);
 end
-       
+
 module:provides("auth", provider);
 
index d109547e4820ed6e07205a871d3e2cf279485129..ca67db738c6c7f644862363e45e9741375f3d3c4 100644 (file)
@@ -78,7 +78,7 @@ function on_destroy_request(request)
                                break;
                        end
                end
-               
+
                -- If this session now has no requests open, mark it as inactive
                local max_inactive = session.bosh_max_inactive;
                if max_inactive and #requests == 0 then
@@ -121,7 +121,7 @@ function handle_POST(event)
        if cross_domain and event.request.headers.origin then
                set_cross_domain_headers(response);
        end
-       
+
        -- stream:feed() calls the stream_callbacks, so all stanzas in
        -- the body are processed in this next line before it returns.
        -- In particular, the streamopened() stream callback is where
@@ -131,7 +131,7 @@ function handle_POST(event)
                module:log("warn", "Error parsing BOSH payload")
                return 400;
        end
-       
+
        -- Stanzas (if any) in the request have now been processed, and
        -- we take care of the high-level BOSH logic here, including
        -- giving a response or putting the request "on hold".
@@ -164,7 +164,7 @@ function handle_POST(event)
                        session.send_buffer = {};
                        session.send(resp);
                end
-               
+
                if not response.finished then
                        -- We're keeping this request open, to respond later
                        log("debug", "Have nothing to say, so leaving request unanswered for now");
@@ -172,7 +172,7 @@ function handle_POST(event)
                                waiting_requests[response] = os_time() + session.bosh_wait;
                        end
                end
-               
+
                if session.bosh_terminate then
                        session.log("debug", "Closing session with %d requests open", #session.requests);
                        session:close();
@@ -192,10 +192,10 @@ local stream_xmlns_attr = { xmlns = "urn:ietf:params:xml:ns:xmpp-streams" };
 
 local function bosh_close_stream(session, reason)
        (session.log or log)("info", "BOSH client disconnected");
-       
+
        local close_reply = st.stanza("body", { xmlns = xmlns_bosh, type = "terminate",
                ["xmlns:stream"] = xmlns_streams });
-       
+
 
        if reason then
                close_reply.attr.condition = "remote-stream-error";
@@ -236,7 +236,7 @@ function stream_callbacks.streamopened(context, attr)
        if not sid then
                -- New session request
                context.notopen = nil; -- Signals that we accept this opening tag
-               
+
                -- TODO: Sanity checks here (rid, to, known host, etc.)
                if not hosts[attr.to] then
                        -- Unknown host
@@ -246,7 +246,7 @@ function stream_callbacks.streamopened(context, attr)
                        response:send(tostring(close_reply));
                        return;
                end
-               
+
                -- New session
                sid = new_uuid();
                local session = {
@@ -259,9 +259,9 @@ function stream_callbacks.streamopened(context, attr)
                        ip = get_ip_from_request(request);
                };
                sessions[sid] = session;
-               
+
                local filter = initialize_filters(session);
-               
+
                session.log("debug", "BOSH session created for request from %s", session.ip);
                log("info", "New BOSH session, assigned it sid '%s'", sid);
 
@@ -308,7 +308,7 @@ function stream_callbacks.streamopened(context, attr)
                end
                request.sid = sid;
        end
-       
+
        local session = sessions[sid];
        if not session then
                -- Unknown sid
@@ -317,7 +317,7 @@ function stream_callbacks.streamopened(context, attr)
                context.notopen = nil;
                return;
        end
-       
+
        if session.rid then
                local rid = tonumber(attr.rid);
                local diff = rid - session.rid;
@@ -334,7 +334,7 @@ function stream_callbacks.streamopened(context, attr)
                end
                session.rid = rid;
        end
-       
+
        if attr.type == "terminate" then
                -- Client wants to end this session, which we'll do
                -- after processing any stanzas in this request
@@ -388,7 +388,7 @@ function stream_callbacks.error(context, error)
                response:send();
                return;
        end
-       
+
        local session = sessions[context.sid];
        if error == "stream-error" then -- Remote stream error, we close normally
                session:close();
@@ -412,7 +412,7 @@ function on_timer()
                        end
                end
        end
-       
+
        now = now - 3;
        local n_dead_sessions = 0;
        for session, close_after in pairs(inactive_sessions) do
index 79a16e2922362bc7190962cd739128916770dfc0..fbac12cdd41471e5d82c2d0f7e3e541206de6e2c 100644 (file)
@@ -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.
 --
@@ -154,10 +154,10 @@ local function session_close(session, reason)
                        log("debug", "Disconnecting client, <stream:error> is: %s", stream_error);
                        session.send(stream_error);
                end
-               
+
                session.send("</stream:stream>");
                function session.send() return false; end
-               
+
                local reason = (reason and (reason.name or reason.text or reason.condition)) or reason;
                session.log("info", "c2s stream for %s closed: %s", session.full_jid or ("<"..session.ip..">"), reason or "session closed");
 
@@ -193,9 +193,9 @@ end, 200);
 function listener.onconnect(conn)
        local session = sm_new_session(conn);
        sessions[conn] = session;
-       
+
        session.log("info", "Client connected");
-       
+
        -- Client is using legacy SSL (otherwise mod_tls sets this flag)
        if conn:ssl() then
                session.secure = true;
@@ -208,22 +208,22 @@ function listener.onconnect(conn)
                        session.compressed = sock:compression(); --COMPAT mw/luasec-hg
                end
        end
-       
+
        if opt_keepalives then
                conn:setoption("keepalive", opt_keepalives);
        end
-       
+
        session.close = session_close;
-       
+
        local stream = new_xmpp_stream(session, stream_callbacks);
        session.stream = stream;
        session.notopen = true;
-       
+
        function session.reset_stream()
                session.notopen = true;
                session.stream:reset();
        end
-       
+
        session.thread = coroutine.create(function (stanza)
                while true do
                        core_process_stanza(session, stanza);
index a5767c9a33039ed0653266d2714630dcbbd93041..3eaacb8eaf123994cea5237db7163c11b51cf5a4 100644 (file)
@@ -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.
 --
@@ -31,7 +31,7 @@ function module.add_host(module)
        if module:get_host_type() ~= "component" then
                error("Don't load mod_component manually, it should be for a component, please see http://prosody.im/doc/components", 0);
        end
-       
+
        local env = module.environment;
        env.connected = false;
 
@@ -42,26 +42,26 @@ function module.add_host(module)
                send = nil;
                session.on_destroy = nil;
        end
-       
+
        -- Handle authentication attempts by component
        local function handle_component_auth(event)
                local session, stanza = event.origin, event.stanza;
-               
+
                if session.type ~= "component_unauthed" then return; end
-       
+
                if (not session.host) or #stanza.tags > 0 then
                        (session.log or log)("warn", "Invalid component handshake for host: %s", session.host);
                        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
@@ -69,13 +69,13 @@ function module.add_host(module)
                        session:close{ condition = "not-authorized", text = "Given token does not match calculated token" };
                        return true;
                end
-               
+
                if env.connected then
                        module:log("error", "Second component attempted to connect, denying connection");
                        session:close{ condition = "conflict", text = "Component already connected" };
                        return true;
                end
-               
+
                env.connected = true;
                send = session.send;
                session.on_destroy = on_destroy;
@@ -83,7 +83,7 @@ function module.add_host(module)
                session.type = "component";
                module:log("info", "External component successfully authenticated");
                session.send(st.stanza("handshake"));
-       
+
                return true;
        end
        module:hook("stanza/jabber:component:accept:handshake", handle_component_auth);
@@ -114,7 +114,7 @@ function module.add_host(module)
                end
                return true;
        end
-       
+
        module:hook("iq/bare", handle_stanza, -1);
        module:hook("message/bare", handle_stanza, -1);
        module:hook("presence/bare", handle_stanza, -1);
@@ -269,14 +269,14 @@ function listener.onconnect(conn)
        local conn_name = "jcp"..tostring(session):match("[a-f0-9]+$");
        session.log = logger.init(conn_name);
        session.close = session_close;
-       
+
        session.log("info", "Incoming Jabber component connection");
-       
+
        local stream = new_xmpp_stream(session, stream_callbacks);
        session.stream = stream;
-       
+
        session.notopen = true;
-       
+
        function session.reset_stream()
                session.notopen = true;
                session.stream:reset();
@@ -288,7 +288,7 @@ function listener.onconnect(conn)
                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;
 
        sessions[conn] = session;
index 928560993bcd367d61cdd45c106a69365b08235e..f44e8a6d6ac80257f5a8d5e2cb696f0831eb9cd8 100644 (file)
@@ -1,6 +1,6 @@
 -- Prosody IM
 -- Copyright (C) 2009-2012 Tobias Markmann
--- 
+--
 -- This project is MIT/X11 licensed. Please see the
 -- COPYING file in the source package for more information.
 --
@@ -103,7 +103,7 @@ local function setup_compression(session, deflate_stream)
                        return;
                end
                return compressed;
-       end);   
+       end);
 end
 
 -- setup decompression for a stream
@@ -125,19 +125,19 @@ end
 
 module:hook("stanza/http://jabber.org/protocol/compress:compressed", function(event)
        local session = event.origin;
-       
+
        if session.type == "s2sout_unauthed" or session.type == "s2sout" then
                session.log("debug", "Activating compression...")
                -- create deflate and inflate streams
                local deflate_stream = get_deflate_stream(session);
                if not deflate_stream then return true; end
-               
+
                local inflate_stream = get_inflate_stream(session);
                if not inflate_stream then return true; end
-               
+
                -- setup compression for session.w
                setup_compression(session, deflate_stream);
-                       
+
                -- setup decompression for session.data
                setup_decompression(session, inflate_stream);
                session:reset_stream();
@@ -158,29 +158,29 @@ module:hook("stanza/http://jabber.org/protocol/compress:compress", function(even
                        session.log("debug", "Client tried to establish another compression layer.");
                        return true;
                end
-               
+
                -- checking if the compression method is supported
                local method = stanza:child_with_name("method");
                method = method and (method[1] or "");
                if method == "zlib" then
                        session.log("debug", "zlib compression enabled.");
-                       
+
                        -- create deflate and inflate streams
                        local deflate_stream = get_deflate_stream(session);
                        if not deflate_stream then return true; end
-                       
+
                        local inflate_stream = get_inflate_stream(session);
                        if not inflate_stream then return true; end
-                       
+
                        (session.sends2s or session.send)(st.stanza("compressed", {xmlns=xmlns_compression_protocol}));
                        session:reset_stream();
-                       
+
                        -- setup compression for session.w
                        setup_compression(session, deflate_stream);
-                               
+
                        -- setup decompression for session.data
                        setup_decompression(session, inflate_stream);
-                       
+
                        session.compressed = true;
                elseif method then
                        session.log("debug", "%s compression selected, but we don't support it.", tostring(method));
index 9dcb0ed53112d73f9e4d4460f1c17260b68be2d0..afee9d58cc7ed325d5361dd392987085529f7e1d 100644 (file)
@@ -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.
 --
@@ -35,7 +35,7 @@ end
 
 module:hook("stanza/jabber:server:dialback:verify", function(event)
        local origin, stanza = event.origin, event.stanza;
-       
+
        if origin.type == "s2sin_unauthed" or origin.type == "s2sin" then
                -- We are being asked to verify the key, to ensure it was generated by us
                origin.log("debug", "verifying that dialback key is ours...");
@@ -62,13 +62,13 @@ end);
 
 module:hook("stanza/jabber:server:dialback:result", function(event)
        local origin, stanza = event.origin, event.stanza;
-       
+
        if origin.type == "s2sin_unauthed" or origin.type == "s2sin" then
                -- he wants to be identified through dialback
                -- We need to check the key with the Authoritative server
                local attr = stanza.attr;
                local to, from = nameprep(attr.to), nameprep(attr.from);
-               
+
                if not hosts[to] then
                        -- Not a host that we serve
                        origin.log("info", "%s tried to connect to %s, which we don't serve", from, to);
@@ -77,11 +77,11 @@ module:hook("stanza/jabber:server:dialback:result", function(event)
                elseif not from then
                        origin:close("improper-addressing");
                end
-               
+
                origin.hosts[from] = { dialback_key = stanza[1] };
-               
+
                dialback_requests[from.."/"..origin.streamid] = origin;
-               
+
                -- COMPAT: ejabberd, gmail and perhaps others do not always set 'to' and 'from'
                -- on streams. We fill in the session's to/from here instead.
                if not origin.from_host then
@@ -102,7 +102,7 @@ end);
 
 module:hook("stanza/jabber:server:dialback:verify", function(event)
        local origin, stanza = event.origin, event.stanza;
-       
+
        if origin.type == "s2sout_unauthed" or origin.type == "s2sout" then
                local attr = stanza.attr;
                local dialback_verifying = dialback_requests[attr.from.."/"..(attr.id or "")];
@@ -131,10 +131,10 @@ end);
 
 module:hook("stanza/jabber:server:dialback:result", function(event)
        local origin, stanza = event.origin, event.stanza;
-       
+
        if origin.type == "s2sout_unauthed" or origin.type == "s2sout" then
                -- Remote server is telling us whether we passed dialback
-               
+
                local attr = stanza.attr;
                if not hosts[attr.to] then
                        origin:close("host-unknown");
index 85a544f95a535b489f8ed7b27099e13d4a4e14ea..617495801e37497794c500699745d309fc108b18 100644 (file)
@@ -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.
 --
index dc6976d4febdce5de2cea24e1270b54b3792d40e..be1a5508f87021d24a1c8d064060ba667f711f38 100644 (file)
@@ -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.
 --
@@ -22,7 +22,7 @@ function inject_roster_contacts(event)
        --module:log("debug", "Injecting group members to roster");
        local bare_jid = username.."@"..host;
        if not members[bare_jid] and not members[false] then return; end -- Not a member of any groups
-       
+
        local roster = event.roster;
        local function import_jids_to_roster(group_name)
                for jid in pairs(groups[group_name]) do
@@ -50,7 +50,7 @@ function inject_roster_contacts(event)
                        import_jids_to_roster(group_name);
                end
        end
-       
+
        -- Import public groups
        if members[false] then
                for _, group_name in ipairs(members[false]) do
@@ -58,7 +58,7 @@ function inject_roster_contacts(event)
                        import_jids_to_roster(group_name);
                end
        end
-       
+
        if roster[false] then
                roster[false].version = true;
        end
@@ -84,10 +84,10 @@ end
 function module.load()
        groups_file = module:get_option_string("groups_file");
        if not groups_file then return; end
-       
+
        module:hook("roster-load", inject_roster_contacts);
        datamanager.add_callback(remove_virtual_contacts);
-       
+
        groups = { default = {} };
        members = { };
        local curr_group = "default";
index 0689634ec704a0f08848b75d95fed076f852c96b..95933da5d82529d28e4123134d772fc641e2bb80 100644 (file)
@@ -1,7 +1,7 @@
 -- Prosody IM
 -- Copyright (C) 2008-2012 Matthew Wild
 -- Copyright (C) 2008-2012 Waqas Hussain
--- 
+--
 -- This project is MIT/X11 licensed. Please see the
 -- COPYING file in the source package for more information.
 --
@@ -108,7 +108,7 @@ function module.add_host(module)
                        end
                end
        end
-       
+
        local function http_app_removed(event)
                local app_handlers = apps[event.item.name];
                apps[event.item.name] = nil;
@@ -116,7 +116,7 @@ function module.add_host(module)
                        module:unhook_object_event(server, event, handler);
                end
        end
-       
+
        module:handle_items("http-provider", http_app_added, http_app_removed);
 
        server.add_host(host);
index 2568ea80aa8a73f31d824acfcd9276d206ea1985..0c37e1044eed1ea5b3df81491ac7e1cbcc2e041f 100644 (file)
@@ -53,7 +53,7 @@ local entities = {
 
 local function tohtml(plain)
        return (plain:gsub("[<>&'\"\n]", entities));
-       
+
 end
 
 local function get_page(code, extra)
index 6ab295acf3070c9d2312e72a1a2f15519fb56370..dd04853beb4ecd8b38466a0a205d7acd4ebfd8bf 100644 (file)
@@ -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.
 --
index e7901ab451c1014a73dee303d870b4ad4b9318a2..c6d62e859dbbc526bd17168376907b42299bc7b8 100644 (file)
@@ -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.
 --
index 11053709bc0b99239ab21ce3bd7d080541a48a79..fabf07b478714df6c09a2132ec649ae2625611e3 100644 (file)
@@ -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.
 --
index 5fb664415682661f6fb30fac87152e72b703b3fc..cb5ce0d3c4e6a3676ffa975dcbe70a740bed4309 100644 (file)
@@ -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.
 --
@@ -43,7 +43,7 @@ module:hook("stanza/iq/jabber:iq:auth:query", function(event)
                session.send(st.error_reply(stanza, "modify", "not-acceptable", "Encryption (SSL or TLS) is required to connect to this server"));
                return true;
        end
-       
+
        local username = stanza.tags[1]:child_with_name("username");
        local password = stanza.tags[1]:child_with_name("password");
        local resource = stanza.tags[1]:child_with_name("resource");
index e85da613198d2a17a52e3b5acc7c8a00e4b8aa4e..fc337db09d62a30a57d0f674898e211cde291466 100644 (file)
@@ -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.
 --
@@ -17,7 +17,7 @@ local user_exists = require "core.usermanager".user_exists;
 
 local function process_to_bare(bare, origin, stanza)
        local user = bare_sessions[bare];
-       
+
        local t = stanza.attr.type;
        if t == "error" then
                -- discard
@@ -66,7 +66,7 @@ end
 module:hook("message/full", function(data)
        -- message to full JID recieved
        local origin, stanza = data.origin, data.stanza;
-       
+
        local session = full_sessions[stanza.attr.to];
        if session and session.send(stanza) then
                return true;
index ed78294b1fd07a78ced7c9fb5cc04c78974241b3..1e2ee395af1c98d6282759d85a638c6103b5906c 100644 (file)
@@ -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.
 --
index 1ac62f94737a70ad17ab5401ab01a63c2776d5f9..c168711b65d381606d6ed6e6be72f2f5ac782039 100644 (file)
@@ -1,7 +1,7 @@
 -- Prosody IM
 -- Copyright (C) 2008-2009 Matthew Wild
 -- Copyright (C) 2008-2009 Waqas Hussain
--- 
+--
 -- This project is MIT/X11 licensed. Please see the
 -- COPYING file in the source package for more information.
 --
@@ -24,11 +24,11 @@ module:hook("message/offline/handle", function(event)
        else
                node, host = origin.username, origin.host;
        end
-       
+
        stanza.attr.stamp, stanza.attr.stamp_legacy = datetime.datetime(), datetime.legacy();
        local result = datamanager.list_append(node, host, "offline", st.preserialize(stanza));
        stanza.attr.stamp, stanza.attr.stamp_legacy = nil, nil;
-       
+
        return result;
 end);
 
index 778f83ed9c15d1ffbabb7b2b6de1864f89abddf7..04f7022101be9300a1e9c388dc5789a586ae2dc9 100644 (file)
@@ -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.
 --
index 0bfcac667d96e332573c7a4be1efb38a46f0f37b..eddb92d245ca92b927cedef079c889afcfe6e336 100644 (file)
@@ -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.
 --
index 28fd7f382e6aa08fb5e6de8c57f33942b70c6156..7a6ccd9478ba13fbb0b4c292914b4c044f5ef64c 100644 (file)
@@ -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.
 --
@@ -183,7 +183,7 @@ if signal.signal then
                prosody.reload_config();
                prosody.reopen_logfiles();
        end);
-       
+
        signal.signal("SIGINT", function ()
                module:log("info", "Received SIGINT");
                prosody.unlock_globals();
index 8dac2d358a68d8c348a4c7b737785258e7ffdf74..2899bd7e97e8b7bbbe18d98bcb786b9f944d9709 100644 (file)
@@ -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.
 --
@@ -227,7 +227,7 @@ function handle_inbound_presence_subscriptions_and_probes(origin, stanza, from_b
        local st_from, st_to = stanza.attr.from, stanza.attr.to;
        stanza.attr.from, stanza.attr.to = from_bare, to_bare;
        log("debug", "inbound presence %s from %s for %s", stanza.attr.type, from_bare, to_bare);
-       
+
        if stanza.attr.type == "probe" then
                local result, err = rostermanager.is_contact_subscribed(node, host, from_bare);
                if result then
@@ -312,7 +312,7 @@ module:hook("presence/bare", function(data)
                if t ~= nil and t ~= "unavailable" and t ~= "error" then -- check for subscriptions and probes sent to bare JID
                        return handle_inbound_presence_subscriptions_and_probes(origin, stanza, jid_bare(stanza.attr.from), jid_bare(stanza.attr.to));
                end
-       
+
                local user = bare_sessions[to];
                if user then
                        for _, session in pairs(user.sessions) do
@@ -347,7 +347,7 @@ end);
 module:hook("presence/host", function(data)
        -- inbound presence to the host
        local stanza = data.stanza;
-       
+
        local from_bare = jid_bare(stanza.attr.from);
        local t = stanza.attr.type;
        if t == "probe" then
index 31ace9f9df126eb25ddaf66d40226bb1788ea28d..aaa8e383b5a6a6dbd11b18f304c041c8de576d68 100644 (file)
@@ -2,7 +2,7 @@
 -- Copyright (C) 2009-2010 Matthew Wild
 -- Copyright (C) 2009-2010 Waqas Hussain
 -- Copyright (C) 2009 Thilo Cestonaro
--- 
+--
 -- This project is MIT/X11 licensed. Please see the
 -- COPYING file in the source package for more information.
 --
@@ -103,7 +103,7 @@ end
 
 function createOrReplaceList (privacy_lists, origin, stanza, name, entries)
        local bare_jid = origin.username.."@"..origin.host;
-       
+
        if privacy_lists.lists == nil then
                privacy_lists.lists = {};
        end
@@ -119,14 +119,14 @@ function createOrReplaceList (privacy_lists, origin, stanza, name, entries)
                if to_number(item.attr.order) == nil or to_number(item.attr.order) < 0 or orderCheck[item.attr.order] ~= nil then
                        return {"modify", "bad-request", "Order attribute not valid."};
                end
-               
+
                if item.attr.type ~= nil and item.attr.type ~= "jid" and item.attr.type ~= "subscription" and item.attr.type ~= "group" then
                        return {"modify", "bad-request", "Type attribute not valid."};
                end
-               
+
                local tmp = {};
                orderCheck[item.attr.order] = true;
-               
+
                tmp["type"] = item.attr.type;
                tmp["value"] = item.attr.value;
                tmp["action"] = item.attr.action;
@@ -135,13 +135,13 @@ function createOrReplaceList (privacy_lists, origin, stanza, name, entries)
                tmp["presence-out"] = false;
                tmp["message"] = false;
                tmp["iq"] = false;
-               
+
                if #item.tags > 0 then
                        for _,tag in ipairs(item.tags) do
                                tmp[tag.name] = true;
                        end
                end
-               
+
                if tmp.type == "subscription" then
                        if      tmp.value ~= "both" and
                                tmp.value ~= "to" and
@@ -150,13 +150,13 @@ function createOrReplaceList (privacy_lists, origin, stanza, name, entries)
                                return {"cancel", "bad-request", "Subscription value must be both, to, from or none."};
                        end
                end
-               
+
                if tmp.action ~= "deny" and tmp.action ~= "allow" then
                        return {"cancel", "bad-request", "Action must be either deny or allow."};
                end
                list.items[#list.items + 1] = tmp;
        end
-       
+
        table.sort(list, function(a, b) return a.order < b.order; end);
 
        origin.send(st.reply(stanza));
@@ -207,14 +207,14 @@ function getList(privacy_lists, origin, stanza, name)
                        return {"cancel", "item-not-found", "Unknown list specified."};
                end
        end
-       
+
        origin.send(reply);
        return true;
 end
 
 module:hook("iq/bare/jabber:iq:privacy:query", function(data)
        local origin, stanza = data.origin, data.stanza;
-       
+
        if stanza.attr.to == nil then -- only service requests to own bare JID
                local query = stanza.tags[1]; -- the query element
                local valid = false;
@@ -285,12 +285,12 @@ function checkIfNeedToBeBlocked(e, session)
        local bare_jid = session.username.."@"..session.host;
        local to = stanza.attr.to or bare_jid;
        local from = stanza.attr.from;
-       
+
        local is_to_user = bare_jid == jid_bare(to);
        local is_from_user = bare_jid == jid_bare(from);
-       
+
        --module:log("debug", "stanza: %s, to: %s, from: %s", tostring(stanza.name), tostring(to), tostring(from));
-       
+
        if privacy_lists.lists == nil or
                not (session.activePrivacyList or privacy_lists.default)
        then
@@ -300,7 +300,7 @@ function checkIfNeedToBeBlocked(e, session)
                --module:log("debug", "Not blocking communications between user's resources");
                return; -- from one of a user's resource to another => HANDS OFF!
        end
-       
+
        local listname = session.activePrivacyList;
        if listname == nil then
                listname = privacy_lists.default; -- no active list selected, use default list
index 365a997c8d99abce4755d7d7841760c5581ff1f8..446a80b2a6a229a7328fada05e6b625169425093 100644 (file)
@@ -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.
 --
index 1fa42bd86b88e299eddde68c12f4a364a17227a5..2ed9faace27d747c0f228b96b1d7f334efe9fe13 100644 (file)
@@ -2,7 +2,7 @@
 -- Copyright (C) 2008-2011 Matthew Wild
 -- Copyright (C) 2008-2011 Waqas Hussain
 -- Copyright (C) 2009 Thilo Cestonaro
--- 
+--
 -- This project is MIT/X11 licensed. Please see the
 -- COPYING file in the source package for more information.
 --
@@ -30,7 +30,7 @@ function listener.onincoming(conn, data)
                (conn == initiator and target or initiator):write(data);
                return;
        end -- FIXME server.link should be doing this?
-       
+
        if not session.greeting_done then
                local nmethods = data:byte(2) or 0;
                if data:byte(1) == 0x05 and nmethods > 0 and #data == 2 + nmethods then -- check if we have all the data
@@ -90,7 +90,7 @@ end
 
 function module.add_host(module)
        local host, name = module:get_host(), module:get_option_string("name", "SOCKS5 Bytestreams Service");
-       
+
        local proxy_address = module:get_option("proxy65_address", host);
        local proxy_port = next(portmanager.get_active_services():search("proxy65", nil)[1] or {});
        local proxy_acl = module:get_option("proxy65_acl");
@@ -103,7 +103,7 @@ function module.add_host(module)
 
        module:add_identity("proxy", "bytestreams", name);
        module:add_feature("http://jabber.org/protocol/bytestreams");
-       
+
        module:hook("iq-get/host/http://jabber.org/protocol/disco#info:query", function(event)
                local origin, stanza = event.origin, event.stanza;
                if not stanza.tags[1].attr.node then
@@ -113,7 +113,7 @@ function module.add_host(module)
                        return true;
                end
        end, -1);
-       
+
        module:hook("iq-get/host/http://jabber.org/protocol/disco#items:query", function(event)
                local origin, stanza = event.origin, event.stanza;
                if not stanza.tags[1].attr.node then
@@ -121,10 +121,10 @@ function module.add_host(module)
                        return true;
                end
        end, -1);
-       
+
        module:hook("iq-get/host/http://jabber.org/protocol/bytestreams:query", function(event)
                local origin, stanza = event.origin, event.stanza;
-               
+
                -- check ACL
                while proxy_acl and #proxy_acl > 0 do -- using 'while' instead of 'if' so we can break out of it
                        local jid = stanza.attr.from;
@@ -137,22 +137,22 @@ function module.add_host(module)
                        origin.send(st.error_reply(stanza, "auth", "forbidden"));
                        return true;
                end
-       
+
                local sid = stanza.tags[1].attr.sid;
                origin.send(st.reply(stanza):tag("query", {xmlns="http://jabber.org/protocol/bytestreams", sid=sid})
                        :tag("streamhost", {jid=host, host=proxy_address, port=proxy_port}));
                return true;
        end);
-       
+
        module:hook("iq-set/host/http://jabber.org/protocol/bytestreams:query", function(event)
                local origin, stanza = event.origin, event.stanza;
-       
+
                local query = stanza.tags[1];
                local sid = query.attr.sid;
                local from = stanza.attr.from;
                local to = query:get_child_text("activate");
                local prepped_to = jid_prep(to);
-       
+
                local info = "sid: "..tostring(sid)..", initiator: "..tostring(from)..", target: "..tostring(prepped_to or to);
                if prepped_to and sid then
                        local sha = sha1(sid .. from .. prepped_to, true);
index 5b03c48033250e586fb9e77705258583c889894b..e537e9036cb11e38e78b0b683f0e99f8da215e33 100644 (file)
@@ -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.
 --
@@ -102,16 +102,16 @@ local function handle_registration_stanza(event)
                                session.send(st.reply(stanza));
                                return old_session_close(session, ...);
                        end
-                       
+
                        local ok, err = usermanager_delete_user(username, host);
-                       
+
                        if not ok then
                                module:log("debug", "Removing user account %s@%s failed: %s", username, host, err);
                                session.close = old_session_close;
                                session.send(st.error_reply(stanza, "cancel", "service-unavailable", err));
                                return true;
                        end
-                       
+
                        module:log("info", "User removed their account: %s@%s", username, host);
                        module:fire_event("user-deregistered", { username = username, host = host, source = "mod_register", session = session });
                else
@@ -206,7 +206,7 @@ module:hook("stanza/iq/jabber:iq:register:query", function(event)
                                                else
                                                        local ip = recent_ips[session.ip];
                                                        ip.count = ip.count + 1;
-                                                       
+
                                                        if os_time() - ip.time < min_seconds_between_registrations then
                                                                ip.time = os_time();
                                                                session.send(st.error_reply(stanza, "wait", "not-acceptable"));
index d530bb456eeb9e55bce64bd745aa56fb6a8f2ceb..56af53684c304c3f621ffdbe60a542d1e8762721 100644 (file)
@@ -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.
 --
@@ -36,10 +36,10 @@ module:hook("iq/self/jabber:iq:roster:query", function(event)
 
        if stanza.attr.type == "get" then
                local roster = st.reply(stanza);
-               
+
                local client_ver = tonumber(stanza.tags[1].attr.ver);
                local server_ver = tonumber(session.roster[false].version or 1);
-               
+
                if not (client_ver and server_ver) or client_ver ~= server_ver then
                        roster:query("jabber:iq:roster");
                        -- Client does not support versioning, or has stale roster
index c628dc47cfc615d3de96f9a75dca1c356ea957b2..d64a02acacf35e8dc7ebc44639bfea3171168fc5 100644 (file)
@@ -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.
 --
@@ -155,9 +155,9 @@ end
 -- Stream is authorised, and ready for normal stanzas
 function mark_connected(session)
        local sendq, send = session.sendq, session.sends2s;
-       
+
        local from, to = session.from_host, session.to_host;
-       
+
        session.log("info", "%s s2s connection %s->%s complete", session.direction, from, to);
 
        local event_data = { session = session };
@@ -173,7 +173,7 @@ function mark_connected(session)
                fire_global_event("s2sin-established", event_data);
                hosts[to].events.fire_event("s2sin-established", event_data);
        end
-       
+
        if session.direction == "outgoing" then
                if sendq then
                        session.log("debug", "sending %d queued stanzas across new outgoing connection to %s", #sendq, session.to_host);
@@ -183,7 +183,7 @@ function mark_connected(session)
                        end
                        session.sendq = nil;
                end
-               
+
                session.ip_hosts = nil;
                session.srv_hosts = nil;
        end
@@ -218,9 +218,9 @@ function make_authenticated(event)
                return false;
        end
        session.log("debug", "connection %s->%s is now authenticated for %s", session.from_host, session.to_host, host);
-       
+
        mark_connected(session);
-       
+
        return true;
 end
 
@@ -277,9 +277,9 @@ local xmlns_xmpp_streams = "urn:ietf:params:xml:ns:xmpp-streams";
 
 function stream_callbacks.streamopened(session, attr)
        local send = session.sends2s;
-       
+
        session.version = tonumber(attr.version) or 0;
-       
+
        -- TODO: Rename session.secure to session.encrypted
        if session.secure == false then
                session.secure = true;
@@ -298,7 +298,7 @@ function stream_callbacks.streamopened(session, attr)
 
        if session.direction == "incoming" then
                -- Send a reply stream header
-               
+
                -- Validate to/from
                local to, from = nameprep(attr.to), nameprep(attr.from);
                if not to and attr.to then -- COMPAT: Some servers do not reliably set 'to' (especially on stream restarts)
@@ -309,7 +309,7 @@ function stream_callbacks.streamopened(session, attr)
                        session:close({ condition = "improper-addressing", text = "Invalid 'from' address" });
                        return;
                end
-               
+
                -- Set session.[from/to]_host if they have not been set already and if
                -- this session isn't already authenticated
                if session.type == "s2sin_unauthed" and from and not session.from_host then
@@ -324,10 +324,10 @@ function stream_callbacks.streamopened(session, attr)
                        session:close({ condition = "improper-addressing", text = "New stream 'to' attribute does not match original" });
                        return;
                end
-               
+
                -- For convenience we'll put the sanitised values into these variables
                to, from = session.to_host, session.from_host;
-               
+
                session.streamid = uuid_gen();
                (session.log or log)("debug", "Incoming s2s received %s", st.stanza("stream:stream", attr):top_tag());
                if to then
@@ -362,13 +362,13 @@ function stream_callbacks.streamopened(session, attr)
                session:open_stream(session.to_host, session.from_host)
                if session.version >= 1.0 then
                        local features = st.stanza("stream:features");
-                       
+
                        if to then
                                hosts[to].events.fire_event("s2s-stream-features", { origin = session, features = features });
                        else
                                (session.log or log)("warn", "No 'to' on stream header from %s means we can't offer any features", from or "unknown host");
                        end
-                       
+
                        log("debug", "Sending stream features: %s", tostring(features));
                        send(features);
                end
@@ -396,7 +396,7 @@ function stream_callbacks.streamopened(session, attr)
                        end
                end
                session.send_buffer = nil;
-       
+
                -- If server is pre-1.0, don't wait for features, just do dialback
                if session.version < 1.0 then
                        if not session.dialback_verifying then
@@ -489,10 +489,10 @@ local function session_close(session, reason, remote_reason)
 
                session.sends2s("</stream:stream>");
                function session.sends2s() return false; end
-               
+
                local reason = remote_reason or (reason and (reason.text or reason.condition)) or reason;
                session.log("info", "%s s2s stream %s->%s closed: %s", session.direction, session.from_host or "(unknown host)", session.to_host or "(unknown host)", reason or "stream closed");
-               
+
                -- Authenticated incoming stream may still be sending us stanzas, so wait for </stream:stream> from remote
                local conn = session.conn;
                if reason == nil and not session.notopen and session.type == "s2sin" then
@@ -532,16 +532,16 @@ end
 local function initialize_session(session)
        local stream = new_xmpp_stream(session, stream_callbacks);
        session.stream = stream;
-       
+
        session.notopen = true;
-               
+
        function session.reset_stream()
                session.notopen = true;
                session.stream:reset();
        end
 
        session.open_stream = session_open_stream;
-       
+
        local filter = session.filter;
        function session.data(data)
                data = filter("bytes/in", data);
@@ -596,7 +596,7 @@ function listener.onconnect(conn)
                                end
                        end
                end
-       
+
                initialize_session(session);
        else -- Outgoing session connected
                session:open_stream(session.from_host, session.to_host);
@@ -610,7 +610,7 @@ function listener.onincoming(conn, data)
                session.data(data);
        end
 end
-       
+
 function listener.onstatus(conn, status)
        if status == "ssl-handshake-complete" then
                local session = sessions[conn];
@@ -658,7 +658,7 @@ function check_auth_policy(event)
        elseif must_secure and insecure_domains[host] then
                must_secure = false;
        end
-       
+
        if must_secure and (session.cert_chain_status ~= "valid" or session.cert_identity_status ~= "valid") then
                module:log("warn", "Forbidding insecure connection to/from %s", host);
                if session.direction == "incoming" then
index 575d37acc676369bcdd7b1eb1f68ea46f2a2d4cb..10ee4f0edb37c0e6382c14ce019979f69c282fc6 100644 (file)
@@ -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.
 --
@@ -47,14 +47,14 @@ end
 function s2sout.initiate_connection(host_session)
        initialize_filters(host_session);
        host_session.version = 1;
-       
+
        -- Kick the connection attempting machine into life
        if not s2sout.attempt_connection(host_session) then
                -- Intentionally not returning here, the
                -- session is needed, connected or not
                s2s_destroy_session(host_session);
        end
-       
+
        if not host_session.sends2s then
                -- A sends2s which buffers data (until the stream is opened)
                -- note that data in this buffer will be sent before the stream is authed
@@ -75,11 +75,11 @@ end
 function s2sout.attempt_connection(host_session, err)
        local to_host = host_session.to_host;
        local connect_host, connect_port = to_host and idna_to_ascii(to_host), 5269;
-       
+
        if not connect_host then
                return false;
        end
-       
+
        if not err then -- This is our first attempt
                log("debug", "First attempt to connect to %s, starting with SRV lookup...", to_host);
                host_session.connecting = true;
@@ -100,7 +100,7 @@ function s2sout.attempt_connection(host_session, err)
                                        return;
                                end
                                t_sort(srv_hosts, compare_srv_priorities);
-                               
+
                                local srv_choice = srv_hosts[1];
                                host_session.srv_choice = 1;
                                if srv_choice then
@@ -119,7 +119,7 @@ function s2sout.attempt_connection(host_session, err)
                                end
                        end
                end, "_xmpp-server._tcp."..connect_host..".", "SRV");
-               
+
                return true; -- Attempt in progress
        elseif host_session.ip_hosts then
                return s2sout.try_connect(host_session, connect_host, connect_port, err);
@@ -133,7 +133,7 @@ function s2sout.attempt_connection(host_session, err)
                -- We're out of options
                return false;
        end
-       
+
        if not (connect_host and connect_port) then
                -- Likely we couldn't resolve DNS
                log("warn", "Hmm, we're without a host (%s) and port (%s) to connect to for %s, giving up :(", tostring(connect_host), tostring(connect_port), tostring(to_host));
@@ -280,7 +280,7 @@ function s2sout.make_connect(host_session, connect_host, connect_port)
        else
                handler = "Unsupported protocol: "..tostring(proto);
        end
-       
+
        if not conn then
                log("warn", "Failed to create outgoing connection, system error: %s", handler);
                return false, handler;
@@ -292,10 +292,10 @@ function s2sout.make_connect(host_session, connect_host, connect_port)
                log("warn", "s2s connect() to %s (%s:%d) failed: %s", host_session.to_host, connect_host.addr, connect_port, err);
                return false, err;
        end
-       
+
        conn = wrapclient(conn, connect_host.addr, connect_port, s2s_listener, "*a");
        host_session.conn = conn;
-       
+
        local filter = initialize_filters(host_session);
        local w, log = conn.write, host_session.log;
        host_session.sends2s = function (t)
@@ -310,11 +310,11 @@ function s2sout.make_connect(host_session, connect_host, connect_port)
                        end
                end
        end
-       
+
        -- Register this outgoing connection so that xmppserver_listener knows about it
        -- otherwise it will assume it is a new incoming connection
        s2s_listener.register_outgoing(conn, host_session);
-       
+
        log("debug", "Connection attempt in progress...");
        return true;
 end
index 201cc477de9eed5980a6ec31eaeb6a298afd5b21..1bf6fb96f1bd2332333ab4afa1d3367f1ccf04d3 100644 (file)
@@ -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.
 --
index eed3fec900784518a8860b1d5ed79199a85e397b..1f453d429bf710a3b7d6fca6a20aa45d0a7bf6d9 100644 (file)
@@ -93,7 +93,7 @@ local function create_table()
        elseif params.driver == "MySQL" then
                create_sql = create_sql:gsub("`value` TEXT", "`value` MEDIUMTEXT");
        end
-       
+
        local stmt, err = connection:prepare(create_sql);
        if stmt then
                local ok = stmt:execute();
@@ -159,18 +159,18 @@ do -- process options to get a db connection
        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());
-       
+
        -- Automatically create table, ignore failure (table probably already exists)
        create_table();
 end
@@ -209,7 +209,7 @@ local function dosql(sql, ...)
        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 getsql(sql, ...)
@@ -236,7 +236,7 @@ end
 local function keyval_store_get()
        local stmt, err = getsql("SELECT * FROM `prosody` WHERE `host`=? AND `user`=? AND `store`=?");
        if not stmt then return rollback(nil, err); end
-       
+
        local haveany;
        local result = {};
        for row in stmt:rows(true) do
@@ -256,7 +256,7 @@ end
 local function keyval_store_set(data)
        local affected, err = setsql("DELETE FROM `prosody` WHERE `host`=? AND `user`=? AND `store`=?");
        if not affected then return rollback(affected, err); end
-       
+
        if data and next(data) ~= nil then
                local extradata = {};
                for key, value in pairs(data) do
@@ -314,7 +314,7 @@ end
 local function map_store_get(key)
        local stmt, err = getsql("SELECT * FROM `prosody` WHERE `host`=? AND `user`=? AND `store`=? AND `key`=?", key or "");
        if not stmt then return rollback(nil, err); end
-       
+
        local haveany;
        local result = {};
        for row in stmt:rows(true) do
@@ -334,7 +334,7 @@ end
 local function map_store_set(key, data)
        local affected, err = setsql("DELETE FROM `prosody` WHERE `host`=? AND `user`=? AND `store`=? AND `key`=?", key or "");
        if not affected then return rollback(affected, err); end
-       
+
        if data and next(data) ~= nil then
                if type(key) == "string" and key ~= "" then
                        local t, value = serialize(data);
@@ -365,15 +365,15 @@ local list_store = {};
 list_store.__index = list_store;
 function list_store:scan(username, from, to, jid, typ)
        user,store = username,self.store;
-       
+
        local cols = {"from", "to", "jid", "typ"};
        local vals = { from ,  to ,  jid ,  typ };
        local stmt, err;
        local query = "SELECT * FROM `prosodyarchive` WHERE `host`=? AND `user`=? AND `store`=?";
-       
+
        query = query.." ORDER BY time";
        --local stmt, err = getsql("SELECT * FROM `prosody` WHERE `host`=? AND `user`=? AND `store`=? AND `key`=?", key or "");
-       
+
        return nil, "not-implemented"
 end
 
index 8ce5a72242bc8d32098a534ff931aee790e5f698..3c5f9d2024e18ba3610066159e09ce767105c8fa 100644 (file)
@@ -137,16 +137,16 @@ end
 
 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");
 
        --local dburi = db2uri(params);
        engine = mod_sql:create_engine(params);
-       
+
        -- Encoding mess
        set_encoding();
 
@@ -204,7 +204,7 @@ local function keyval_store_get()
 end
 local function keyval_store_set(data)
        engine:delete("DELETE FROM `prosody` WHERE `host`=? AND `user`=? AND `store`=?", host, user or "", store);
-       
+
        if data and next(data) ~= nil then
                local extradata = {};
                for key, value in pairs(data) do
index cb69ebe791d1d1d1920e24a8d291fe9a6a22adad..ae7da91627b195bdb661866972e7ebeffd742c95 100644 (file)
@@ -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.
 --
index 1af8dbe9e134bbe81fc8bb80997d323be826d8b0..bab2202ea7eb01b0216944e40aa2359ca6a9a07c 100644 (file)
@@ -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.
 --
index 3f275b2fe7efcdce55c7612c5fe8722080bedc11..2e369b16f38a25ab21d363bfe7ebb90171eda64f 100644 (file)
@@ -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.
 --
index 26b30e3ab3c10621e9f8fa47a9eb05a4cca8413b..72f92ef763d70015598ec2332923ece774e934ea 100644 (file)
@@ -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.
 --
index d35103b643266f7d5ef6dcab88951793b1f87e0c..be244beb31fd1c75bd7aa20bcc458056a3d3f3ef 100644 (file)
@@ -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.
 --
index abca90bdab36103d3fb3ab16c0d42a2e923b8a84..b7be5daf8e8a945aa29de64e82b57d762a089a7f 100644 (file)
@@ -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.
 --
index e498f0b31f8c0f19973d396b8981d9b168d0258b..9c0c821b582b6b771c37f6a1672c8b17aad5f681 100644 (file)
@@ -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.
 --
index a9480465c0417adf5c3f043b03ee2c9c6936393c..6b4c70065125b88e08bff62dc07671e6ab4352e3 100644 (file)
@@ -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.
 --
@@ -16,7 +16,7 @@ local muc_name = module:get_option("name");
 if type(muc_name) ~= "string" then muc_name = "Prosody Chatrooms"; end
 local restrict_room_creation = module:get_option("restrict_room_creation");
 if restrict_room_creation then
-       if restrict_room_creation == true then 
+       if restrict_room_creation == true then
                restrict_room_creation = "admin";
        elseif restrict_room_creation ~= "admin" and restrict_room_creation ~= "local" then
                restrict_room_creation = nil;
index 483b0812b0d7e538c90a64b435f9bda0938158c6..8800640f40edf4458caec256e7828e80983ee180 100644 (file)
@@ -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.
 --
@@ -147,10 +147,10 @@ function room_mt:send_history(to, stanza)
        if history then
                local x_tag = stanza and stanza:get_child("x", "http://jabber.org/protocol/muc");
                local history_tag = x_tag and x_tag:get_child("history", "http://jabber.org/protocol/muc");
-               
+
                local maxchars = history_tag and tonumber(history_tag.attr.maxchars);
                if maxchars then maxchars = math.floor(maxchars); end
-               
+
                local maxstanzas = math.floor(history_tag and tonumber(history_tag.attr.maxstanzas) or #history);
                if not history_tag then maxstanzas = 20; end
 
@@ -163,7 +163,7 @@ function room_mt:send_history(to, stanza)
 
                local n = 0;
                local charcount = 0;
-               
+
                for i=#history,1,-1 do
                        local entry = history[i];
                        if maxchars then
@@ -351,7 +351,7 @@ local function construct_stanza_id(room, stanza)
        local from_nick = room._jid_nick[from_jid];
        local occupant = room._occupants[to_nick];
        local to_jid = occupant.jid;
-       
+
        return from_nick, to_jid, base64.encode(to_jid.."\0"..stanza.attr.id.."\0"..md5(from_jid));
 end
 local function deconstruct_stanza_id(room, stanza)
index 7dceeaede07381d06078f3e0bac0494f177ba785..100dbe8302bb2d8e03c87c7e1c5f36232c8f1827 100644 (file)
@@ -18,7 +18,7 @@ function test_value(value, returns)
        assert(module:get_option_number("opt") == returns.number, "number doesn't match");
        assert(module:get_option_string("opt") == returns.string, "string doesn't match");
        assert(module:get_option_boolean("opt") == returns.boolean, "boolean doesn't match");
-       
+
        if type(returns.array) == "table" then
                local target_array, returned_array = returns.array, module:get_option_array("opt");
                assert(#target_array == #returned_array, "array length doesn't match");
@@ -28,7 +28,7 @@ function test_value(value, returns)
        else
                assert(module:get_option_array("opt") == returns.array, "array is returned (not nil)");
        end
-       
+
        if type(returns.set) == "table" then
                local target_items, returned_items = set.new(returns.set), module:get_option_set("opt");
                assert(target_items == returned_items, "set doesn't match");
index b6728061e7ed9332cfb62a53c1495ebb259df917..f7475a805d1395e9c379aa7534f9ecff15a41b89 100644 (file)
@@ -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.
 --
@@ -20,7 +20,7 @@ function run_all_tests()
        dotest "util.ip"
        dotest "util.stanza"
        dotest "util.sasl.scram"
-       
+
        dosingletest("test_sasl.lua", "latin1toutf8");
 end
 
@@ -87,12 +87,12 @@ function dosingletest(testname, fname)
                print("WARNING: ", "Failed to initialise tests for "..testname, err);
                return;
        end
-       
+
        if type(tests[fname]) ~= "function" then
                error(testname.." has no test '"..fname.."'", 0);
        end
-       
-       
+
+
        local line_hook, line_info = new_line_coverage_monitor(testname);
        debug.sethook(line_hook, "l")
        local success, ret = pcall(tests[fname]);
@@ -134,7 +134,7 @@ function dotest(unitname)
                print("WARNING: ", "Failed to load module: "..unitname, err);
                return;
        end
-       
+
        local oldmodule, old_M = _fakeG.module, _fakeG._M;
        _fakeG.module = function () _M = unit end
        setfenv(chunk, unit);
@@ -144,7 +144,7 @@ function dotest(unitname)
                print("WARNING: ", "Failed to initialise module: "..unitname, err);
                return;
        end
-       
+
        if type(ret) == "table" then
                for k,v in pairs(ret) do
                        unit[k] = v;
@@ -197,11 +197,11 @@ end
 function new_line_coverage_monitor(file)
        local lines_hit, funcs_hit = {}, {};
        local total_lines, covered_lines = 0, 0;
-       
+
        for line in io.lines(file) do
                total_lines = total_lines + 1;
        end
-       
+
        return function (event, line) -- Line hook
                        if not lines_hit[line] then
                                local info = debug.getinfo(2, "fSL")
index d79199658eace9f21aff6181de872afea36600ea..5bd469c68ce39f28ec6689f6a3fc0e4590c67086 100644 (file)
@@ -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.
 --
@@ -15,10 +15,10 @@ function get(get, config)
        config.set("*", "testkey1", 321);
        assert_equal(get("*", "testkey1"), 321, "Retrieving a set global key");
        assert_equal(get("example.com", "testkey1"), 321, "Retrieving a set key of undefined host, of which only a globally set one exists");
-       
+
        config.set("example.com", ""); -- Creates example.com host in config
        assert_equal(get("example.com", "testkey1"), 321, "Retrieving a set key, of which only a globally set one exists");
-       
+
        assert_equal(get(), nil, "No parameters to get()");
        assert_equal(get("undefined host"), nil, "Getting for undefined host");
        assert_equal(get("undefined host", "undefined key"), nil, "Getting for undefined host & key");
index 7194d201dd75b99ed3cd4cc31c6e4900e83d6107..d2dbf8301565ef0384c12adf3b78ae148db72b7f 100644 (file)
@@ -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.
 --
@@ -16,7 +16,7 @@ function compare_srv_priorities(csp)
        local r3 = { priority = 1000, weight = 2 }
        local r4 = { priority = 1000, weight = 2 }
        local r5 = { priority = 1000, weight = 5 }
-       
+
        assert_equal(csp(r1, r1), false);
        assert_equal(csp(r1, r2), true);
        assert_equal(csp(r1, r3), true);
index 0a93694f90257100ecd135bf0c0bf151108e29ba..ca6b78fce385c26b166860e900aa6eb76dd58c90 100644 (file)
@@ -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.
 --
@@ -14,7 +14,7 @@ function core_process_stanza(core_process_stanza, u)
        local s2sin_session = { from_host = "remotehost", to_host = "localhost", type = "s2sin", hosts = { ["remotehost"] = { authed = true } } }
        local local_host_session = { host = "localhost", type = "local", s2sout = { ["remotehost"] = s2sout_session } }
        local local_user_session = { username = "user", host = "localhost", resource = "resource", full_jid = "user@localhost/resource", type = "c2s" }
-       
+
        _G.prosody.hosts["localhost"] = local_host_session;
        _G.prosody.full_sessions["user@localhost/resource"] = local_user_session;
        _G.prosody.bare_sessions["user@localhost"] = { sessions = { resource = local_user_session } };
@@ -23,15 +23,15 @@ function core_process_stanza(core_process_stanza, u)
        local function test_message_full_jid()
                local env = testlib_new_env();
                local msg = stanza.stanza("message", { to = "user@localhost/resource", type = "chat" }):tag("body"):text("Hello world");
-               
+
                local target_routed;
-               
+
                function env.core_post_stanza(p_origin, p_stanza)
                        assert_equal(p_origin, local_user_session, "origin of routed stanza is not correct");
                        assert_equal(p_stanza, msg, "routed stanza is not correct one: "..p_stanza:pretty_print());
                        target_routed = true;
                end
-               
+
                env.hosts = hosts;
                env.prosody = { hosts = hosts };
                setfenv(core_process_stanza, env);
@@ -42,9 +42,9 @@ function core_process_stanza(core_process_stanza, u)
        local function test_message_bare_jid()
                local env = testlib_new_env();
                local msg = stanza.stanza("message", { to = "user@localhost", type = "chat" }):tag("body"):text("Hello world");
-               
+
                local target_routed;
-               
+
                function env.core_post_stanza(p_origin, p_stanza)
                        assert_equal(p_origin, local_user_session, "origin of routed stanza is not correct");
                        assert_equal(p_stanza, msg, "routed stanza is not correct one: "..p_stanza:pretty_print());
@@ -60,9 +60,9 @@ function core_process_stanza(core_process_stanza, u)
        local function test_message_no_to()
                local env = testlib_new_env();
                local msg = stanza.stanza("message", { type = "chat" }):tag("body"):text("Hello world");
-               
+
                local target_handled;
-               
+
                function env.core_post_stanza(p_origin, p_stanza)
                        assert_equal(p_origin, local_user_session, "origin of handled stanza is not correct");
                        assert_equal(p_stanza, msg, "handled stanza is not correct one: "..p_stanza:pretty_print());
@@ -78,9 +78,9 @@ function core_process_stanza(core_process_stanza, u)
        local function test_message_to_remote_bare()
                local env = testlib_new_env();
                local msg = stanza.stanza("message", { to = "user@remotehost", type = "chat" }):tag("body"):text("Hello world");
-               
+
                local target_routed;
-               
+
                function env.core_route_stanza(p_origin, p_stanza)
                        assert_equal(p_origin, local_user_session, "origin of handled stanza is not correct");
                        assert_equal(p_stanza, msg, "handled stanza is not correct one: "..p_stanza:pretty_print());
@@ -88,7 +88,7 @@ function core_process_stanza(core_process_stanza, u)
                end
 
                function env.core_post_stanza(...) env.core_route_stanza(...); end
-               
+
                env.hosts = hosts;
                setfenv(core_process_stanza, env);
                assert_equal(core_process_stanza(local_user_session, msg), nil, "core_process_stanza returned incorrect value");
@@ -98,9 +98,9 @@ function core_process_stanza(core_process_stanza, u)
        local function test_message_to_remote_server()
                local env = testlib_new_env();
                local msg = stanza.stanza("message", { to = "remotehost", type = "chat" }):tag("body"):text("Hello world");
-               
+
                local target_routed;
-               
+
                function env.core_route_stanza(p_origin, p_stanza)
                        assert_equal(p_origin, local_user_session, "origin of handled stanza is not correct");
                        assert_equal(p_stanza, msg, "handled stanza is not correct one: "..p_stanza:pretty_print());
@@ -123,9 +123,9 @@ function core_process_stanza(core_process_stanza, u)
        local function test_iq_to_remote_server()
                local env = testlib_new_env();
                local msg = stanza.stanza("iq", { to = "remotehost", type = "get", id = "id" }):tag("body"):text("Hello world");
-               
+
                local target_routed;
-               
+
                function env.core_route_stanza(p_origin, p_stanza)
                        assert_equal(p_origin, local_user_session, "origin of handled stanza is not correct");
                        assert_equal(p_stanza, msg, "handled stanza is not correct one: "..p_stanza:pretty_print());
@@ -145,9 +145,9 @@ function core_process_stanza(core_process_stanza, u)
        local function test_iq_error_to_local_user()
                local env = testlib_new_env();
                local msg = stanza.stanza("iq", { to = "user@localhost/resource", from = "user@remotehost", type = "error", id = "id" }):tag("error", { type = 'cancel' }):tag("item-not-found", { xmlns='urn:ietf:params:xml:ns:xmpp-stanzas' });
-               
+
                local target_routed;
-               
+
                function env.core_route_stanza(p_origin, p_stanza)
                        assert_equal(p_origin, s2sin_session, "origin of handled stanza is not correct");
                        assert_equal(p_stanza, msg, "handled stanza is not correct one: "..p_stanza:pretty_print());
@@ -167,9 +167,9 @@ function core_process_stanza(core_process_stanza, u)
        local function test_iq_to_local_bare()
                local env = testlib_new_env();
                local msg = stanza.stanza("iq", { to = "user@localhost", from = "user@localhost", type = "get", id = "id" }):tag("ping", { xmlns = "urn:xmpp:ping:0" });
-               
+
                local target_handled;
-               
+
                function env.core_post_stanza(p_origin, p_stanza)
                        assert_equal(p_origin, local_user_session, "origin of handled stanza is not correct");
                        assert_equal(p_stanza, msg, "handled stanza is not correct one: "..p_stanza:pretty_print());
@@ -209,11 +209,11 @@ function core_route_stanza(core_route_stanza)
                local msg2 = stanza.stanza("iq", { to = "user@localhost/foo", from = "user@localhost", type = "error" }):tag("ping", { xmlns = "urn:xmpp:ping:0" });
                --package.loaded["core.usermanager"] = { user_exists = function (user, host) print("RAR!") return true or user == "user" and host == "localhost" and true; end };
                local target_handled, target_replied;
-               
+
                function env.core_post_stanza(p_origin, p_stanza)
                        target_handled = true;
                end
-               
+
                function local_user_session.send(data)
                        --print("Replying with: ", tostring(data));
                        --print(debug.traceback())
index 271fa69a5a3b6bd1cad49c4f8d6b17dabcb37e57..dd63c5a00ec403dab610f31d4676ef803bcbcdae 100644 (file)
@@ -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.
 --
@@ -30,7 +30,7 @@ function latin1toutf8()
        local function assert_utf8(latin, utf8)
                        assert_equal(_latin1toutf8(latin), utf8, "Incorrect UTF8 from Latin1: "..tostring(latin));
        end
-       
+
        assert_utf8("", "")
        assert_utf8("test", "test")
        assert_utf8(nil, nil)
index e68f96e9f770f274aff9bcebf620c317883800d5..a195df6be5f12942b49ced6b4a1229ac7c71f8c2 100644 (file)
@@ -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.
 --
index 410f1da24ed43fb6198cf4841ff21f58e9084f17..0ded1123227ed1c287f6d443c4f00ed62f92e934 100644 (file)
@@ -31,9 +31,9 @@ end
 
 function parse_cidr(parse_cidr, _M)
        local new_ip = _M.new_ip;
-       
+
        assert_equal(new_ip"0.0.0.0", new_ip"0.0.0.0")
-       
+
        local function assert_cidr(cidr, ip, bits)
                local parsed_ip, parsed_bits = parse_cidr(cidr);
                assert_equal(new_ip(ip), parsed_ip, cidr.." parsed ip is "..ip);
index a817e644c1a5d4e16ec6b33afb42ea7c5600928c..02a90c3ba983d612fe1d55a90774af1f4904876f 100644 (file)
@@ -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.
 --
index ed10b1283011b6ec64d60ea09d9b138e18edb92c..71a834505b37a13df37744608318b4209759fd18 100644 (file)
@@ -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.
 --
@@ -41,7 +41,7 @@ function get(get, multitable)
        end
 
        mt = multitable.new();
-       
+
        local trigger1, trigger2, trigger3 = {}, {}, {};
        local item1, item2, item3 = {}, {}, {};
 
@@ -51,12 +51,12 @@ function get(get, multitable)
        mt:add(1, 2, 3, item1);
 
        assert_has_all("Has item1 for 1, 2, 3", mt:get(1, 2, 3), item1);
-       
+
 -- Doesn't support nil
 --[[   mt:add(nil, item1);
        mt:add(nil, item2);
        mt:add(nil, item3);
-       
+
        assert_has_all("Has all items with (nil)", mt:get(nil), item1, item2, item3);
 ]]
 end
index fce26f3a7267da0575495e0962edf47341a2f96c..20cc827413b852f8d3080285f139f3e1a178bdd1 100644 (file)
@@ -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.
 --
@@ -18,7 +18,7 @@ end
 
 function deserialize(deserialize, st)
        local stanza = st.stanza("message", { a = "a" });
-       
+
        local stanza2 = deserialize(st.preserialize(stanza));
        assert_is(stanza2 and stanza.name, "deserialize returns a stanza");
        assert_table(stanza2.attr, "Deserialized stanza has attributes");
index 35facd4e45ae0472e3a9eeb0908920b778f5fade..c133e33233b5c45903bef1c16d38b1a95429d74f 100644 (file)
@@ -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.
 --
index ff3004c273e9f32caa012f0d961efc49af93aafe..0a6736d782b11e52389a25cc4fd26dea21ef3301 100755 (executable)
@@ -2,7 +2,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.
 --
index d80b9e469831098efe33bea5f4f4a6430e843dfc..930d5a6b787dd4204ea0de476199525d4d9fb8ff 100644 (file)
@@ -2,7 +2,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.
 --
index 174585d338433d3c9db14a4f722ed4c029e41c68..25c38bcf4d72d1756c18543af1ee9d41ac33c529 100644 (file)
@@ -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.
 --
index d6a6753f0c30f6b52dd654a5690645b64bf9ce46..03376b30ee11a59d3fee8388d76792a854baa096 100644 (file)
@@ -5,242 +5,242 @@ do
 
 
 local _parse_sql_actions = { [0] =
-  0, 1, 0, 1, 1, 2, 0, 2, 2, 0, 9, 2, 0, 10, 2, 0, 11, 2, 0, 13, 
-  2, 1, 2, 2, 1, 6, 3, 0, 3, 4, 3, 0, 3, 5, 3, 0, 3, 7, 3, 0, 
+  0, 1, 0, 1, 1, 2, 0, 2, 2, 0, 9, 2, 0, 10, 2, 0, 11, 2, 0, 13,
+  2, 1, 2, 2, 1, 6, 3, 0, 3, 4, 3, 0, 3, 5, 3, 0, 3, 7, 3, 0,
   3, 8, 3, 0, 3, 12, 4, 0, 2, 3, 7, 4, 0, 3, 8, 11
 };
 
 local _parse_sql_trans_keys = { [0] =
-  0, 0, 45, 45, 10, 10, 42, 42, 10, 42, 10, 47, 82, 82, 
-  69, 69, 65, 65, 84, 84, 69, 69, 32, 32, 68, 84, 65, 
-  65, 84, 84, 65, 65, 66, 66, 65, 65, 83, 83, 69, 69, 
-  9, 47, 9, 96, 45, 45, 10, 10, 42, 42, 10, 42, 10, 47, 
-  10, 96, 10, 96, 9, 47, 9, 59, 45, 45, 10, 10, 42, 
-  42, 10, 42, 10, 47, 65, 65, 66, 66, 76, 76, 69, 69, 
-  32, 32, 73, 96, 70, 70, 32, 32, 78, 78, 79, 79, 84, 84, 
-  32, 32, 69, 69, 88, 88, 73, 73, 83, 83, 84, 84, 83, 
-  83, 32, 32, 96, 96, 10, 96, 10, 96, 32, 32, 40, 40, 
-  10, 10, 32, 41, 32, 32, 75, 96, 69, 69, 89, 89, 32, 32, 
-  96, 96, 10, 96, 10, 96, 10, 10, 82, 82, 73, 73, 77, 
-  77, 65, 65, 82, 82, 89, 89, 32, 32, 75, 75, 69, 69, 
-  89, 89, 32, 32, 78, 78, 73, 73, 81, 81, 85, 85, 69, 69, 
-  32, 32, 75, 75, 10, 96, 10, 96, 10, 10, 10, 59, 10, 
-  59, 82, 82, 79, 79, 80, 80, 32, 32, 84, 84, 65, 65, 
-  66, 66, 76, 76, 69, 69, 32, 32, 73, 73, 70, 70, 32, 32, 
-  69, 69, 88, 88, 73, 73, 83, 83, 84, 84, 83, 83, 32, 
-  32, 96, 96, 10, 96, 10, 96, 59, 59, 78, 78, 83, 83, 
-  69, 69, 82, 82, 84, 84, 32, 32, 73, 73, 78, 78, 84, 84, 
-  79, 79, 32, 32, 96, 96, 10, 96, 10, 96, 32, 32, 40, 
-  86, 10, 41, 32, 32, 86, 86, 65, 65, 76, 76, 85, 85, 
-  69, 69, 83, 83, 32, 32, 40, 40, 39, 78, 10, 92, 10, 92, 
-  41, 44, 44, 59, 32, 78, 48, 57, 41, 57, 48, 57, 41, 
-  57, 85, 85, 76, 76, 76, 76, 34, 116, 79, 79, 67, 67, 
-  75, 75, 32, 32, 84, 84, 65, 65, 66, 66, 76, 76, 69, 69, 
-  83, 83, 32, 32, 96, 96, 10, 96, 10, 96, 32, 32, 87, 
-  87, 82, 82, 73, 73, 84, 84, 69, 69, 69, 69, 84, 84, 
-  32, 32, 10, 59, 10, 59, 78, 83, 76, 76, 79, 79, 67, 67, 
-  75, 75, 32, 32, 84, 84, 65, 65, 66, 66, 76, 76, 69, 
+  0, 0, 45, 45, 10, 10, 42, 42, 10, 42, 10, 47, 82, 82,
+  69, 69, 65, 65, 84, 84, 69, 69, 32, 32, 68, 84, 65,
+  65, 84, 84, 65, 65, 66, 66, 65, 65, 83, 83, 69, 69,
+  9, 47, 9, 96, 45, 45, 10, 10, 42, 42, 10, 42, 10, 47,
+  10, 96, 10, 96, 9, 47, 9, 59, 45, 45, 10, 10, 42,
+  42, 10, 42, 10, 47, 65, 65, 66, 66, 76, 76, 69, 69,
+  32, 32, 73, 96, 70, 70, 32, 32, 78, 78, 79, 79, 84, 84,
+  32, 32, 69, 69, 88, 88, 73, 73, 83, 83, 84, 84, 83,
+  83, 32, 32, 96, 96, 10, 96, 10, 96, 32, 32, 40, 40,
+  10, 10, 32, 41, 32, 32, 75, 96, 69, 69, 89, 89, 32, 32,
+  96, 96, 10, 96, 10, 96, 10, 10, 82, 82, 73, 73, 77,
+  77, 65, 65, 82, 82, 89, 89, 32, 32, 75, 75, 69, 69,
+  89, 89, 32, 32, 78, 78, 73, 73, 81, 81, 85, 85, 69, 69,
+  32, 32, 75, 75, 10, 96, 10, 96, 10, 10, 10, 59, 10,
+  59, 82, 82, 79, 79, 80, 80, 32, 32, 84, 84, 65, 65,
+  66, 66, 76, 76, 69, 69, 32, 32, 73, 73, 70, 70, 32, 32,
+  69, 69, 88, 88, 73, 73, 83, 83, 84, 84, 83, 83, 32,
+  32, 96, 96, 10, 96, 10, 96, 59, 59, 78, 78, 83, 83,
+  69, 69, 82, 82, 84, 84, 32, 32, 73, 73, 78, 78, 84, 84,
+  79, 79, 32, 32, 96, 96, 10, 96, 10, 96, 32, 32, 40,
+  86, 10, 41, 32, 32, 86, 86, 65, 65, 76, 76, 85, 85,
+  69, 69, 83, 83, 32, 32, 40, 40, 39, 78, 10, 92, 10, 92,
+  41, 44, 44, 59, 32, 78, 48, 57, 41, 57, 48, 57, 41,
+  57, 85, 85, 76, 76, 76, 76, 34, 116, 79, 79, 67, 67,
+  75, 75, 32, 32, 84, 84, 65, 65, 66, 66, 76, 76, 69, 69,
+  83, 83, 32, 32, 96, 96, 10, 96, 10, 96, 32, 32, 87,
+  87, 82, 82, 73, 73, 84, 84, 69, 69, 69, 69, 84, 84,
+  32, 32, 10, 59, 10, 59, 78, 83, 76, 76, 79, 79, 67, 67,
+  75, 75, 32, 32, 84, 84, 65, 65, 66, 66, 76, 76, 69,
   69, 83, 83, 69, 69, 9, 85, 0
 };
 
 local _parse_sql_key_spans = { [0] =
-  0, 1, 1, 1, 33, 38, 1, 1, 1, 1, 1, 1, 17, 1, 1, 1, 1, 1, 1, 1, 
-  39, 88, 1, 1, 1, 33, 38, 87, 87, 39, 51, 1, 1, 1, 33, 38, 1, 1, 1, 1, 
-  1, 24, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 87, 87, 1, 1, 
-  1, 10, 1, 22, 1, 1, 1, 1, 87, 87, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 87, 87, 1, 50, 50, 1, 1, 1, 1, 1, 1, 
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 87, 87, 1, 1, 1, 
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 87, 87, 1, 47, 32, 1, 1, 1, 1, 1, 
-  1, 1, 1, 1, 40, 83, 83, 4, 16, 47, 10, 17, 10, 17, 1, 1, 1, 83, 1, 1, 
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 87, 87, 1, 1, 1, 1, 1, 1, 1, 1, 
+  0, 1, 1, 1, 33, 38, 1, 1, 1, 1, 1, 1, 17, 1, 1, 1, 1, 1, 1, 1,
+  39, 88, 1, 1, 1, 33, 38, 87, 87, 39, 51, 1, 1, 1, 33, 38, 1, 1, 1, 1,
+  1, 24, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 87, 87, 1, 1,
+  1, 10, 1, 22, 1, 1, 1, 1, 87, 87, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 87, 87, 1, 50, 50, 1, 1, 1, 1, 1, 1,
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 87, 87, 1, 1, 1,
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 87, 87, 1, 47, 32, 1, 1, 1, 1, 1,
+  1, 1, 1, 1, 40, 83, 83, 4, 16, 47, 10, 17, 10, 17, 1, 1, 1, 83, 1, 1,
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 87, 87, 1, 1, 1, 1, 1, 1, 1, 1,
   1, 50, 50, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 77
 };
 
 local _parse_sql_index_offsets = { [0] =
-  0, 0, 2, 4, 6, 40, 79, 81, 83, 85, 87, 89, 91, 109, 111, 113, 115, 117, 119, 121, 
-  123, 163, 252, 254, 256, 258, 292, 331, 419, 507, 547, 599, 601, 603, 605, 639, 678, 680, 682, 684, 
-  686, 688, 713, 715, 717, 719, 721, 723, 725, 727, 729, 731, 733, 735, 737, 739, 741, 829, 917, 919, 
-  921, 923, 934, 936, 959, 961, 963, 965, 967, 1055, 1143, 1145, 1147, 1149, 1151, 1153, 1155, 1157, 1159, 1161, 
-  1163, 1165, 1167, 1169, 1171, 1173, 1175, 1177, 1179, 1181, 1269, 1357, 1359, 1410, 1461, 1463, 1465, 1467, 1469, 1471, 
-  1473, 1475, 1477, 1479, 1481, 1483, 1485, 1487, 1489, 1491, 1493, 1495, 1497, 1499, 1501, 1503, 1591, 1679, 1681, 1683, 
-  1685, 1687, 1689, 1691, 1693, 1695, 1697, 1699, 1701, 1703, 1705, 1793, 1881, 1883, 1931, 1964, 1966, 1968, 1970, 1972, 
-  1974, 1976, 1978, 1980, 1982, 2023, 2107, 2191, 2196, 2213, 2261, 2272, 2290, 2301, 2319, 2321, 2323, 2325, 2409, 2411, 
-  2413, 2415, 2417, 2419, 2421, 2423, 2425, 2427, 2429, 2431, 2433, 2521, 2609, 2611, 2613, 2615, 2617, 2619, 2621, 2623, 
+  0, 0, 2, 4, 6, 40, 79, 81, 83, 85, 87, 89, 91, 109, 111, 113, 115, 117, 119, 121,
+  123, 163, 252, 254, 256, 258, 292, 331, 419, 507, 547, 599, 601, 603, 605, 639, 678, 680, 682, 684,
+  686, 688, 713, 715, 717, 719, 721, 723, 725, 727, 729, 731, 733, 735, 737, 739, 741, 829, 917, 919,
+  921, 923, 934, 936, 959, 961, 963, 965, 967, 1055, 1143, 1145, 1147, 1149, 1151, 1153, 1155, 1157, 1159, 1161,
+  1163, 1165, 1167, 1169, 1171, 1173, 1175, 1177, 1179, 1181, 1269, 1357, 1359, 1410, 1461, 1463, 1465, 1467, 1469, 1471,
+  1473, 1475, 1477, 1479, 1481, 1483, 1485, 1487, 1489, 1491, 1493, 1495, 1497, 1499, 1501, 1503, 1591, 1679, 1681, 1683,
+  1685, 1687, 1689, 1691, 1693, 1695, 1697, 1699, 1701, 1703, 1705, 1793, 1881, 1883, 1931, 1964, 1966, 1968, 1970, 1972,
+  1974, 1976, 1978, 1980, 1982, 2023, 2107, 2191, 2196, 2213, 2261, 2272, 2290, 2301, 2319, 2321, 2323, 2325, 2409, 2411,
+  2413, 2415, 2417, 2419, 2421, 2423, 2425, 2427, 2429, 2431, 2433, 2521, 2609, 2611, 2613, 2615, 2617, 2619, 2621, 2623,
   2625, 2627, 2678, 2729, 2736, 2738, 2740, 2742, 2744, 2746, 2748, 2750, 2752, 2754, 2756, 2758, 2760
 };
 
 local _parse_sql_indicies = { [0] =
-  0, 1, 2, 0, 3, 1, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 
-  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 
-  4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 
-  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 3, 3, 3, 6, 3, 7, 
-  1, 8, 1, 9, 1, 10, 1, 11, 1, 12, 1, 13, 1, 1, 1, 1, 1, 1, 1, 1, 
-  1, 1, 1, 1, 1, 1, 1, 14, 1, 15, 1, 16, 1, 17, 1, 18, 1, 19, 1, 20, 
-  1, 21, 1, 22, 23, 22, 22, 22, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
-  1, 1, 1, 1, 1, 1, 22, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 24, 
-  1, 25, 1, 22, 23, 22, 22, 22, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
-  1, 1, 1, 1, 1, 1, 22, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 24, 
-  1, 25, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 26, 1, 27, 1, 23, 27, 28, 1, 29, 28, 
-  28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 
-  28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 30, 28, 29, 28, 28, 28, 28, 28, 28, 28, 
-  28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 
-  28, 28, 28, 28, 30, 28, 28, 28, 28, 22, 28, 32, 31, 31, 31, 31, 31, 31, 31, 31, 
-  31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 
-  31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 
-  31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 
-  31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 1, 31, 32, 
-  31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 
-  31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 
-  31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 
-  31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 
-  31, 31, 31, 31, 31, 33, 31, 34, 35, 34, 34, 34, 1, 1, 1, 1, 1, 1, 1, 1, 
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 34, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
-  1, 1, 1, 36, 1, 37, 1, 34, 35, 34, 34, 34, 1, 1, 1, 1, 1, 1, 1, 1, 
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 34, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
-  1, 1, 1, 36, 1, 37, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, 1, 38, 
-  1, 35, 38, 39, 1, 40, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 
-  39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 41, 39, 40, 
-  39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 
-  39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 41, 39, 39, 39, 39, 34, 39, 42, 1, 
-  43, 1, 44, 1, 45, 1, 46, 1, 47, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 48, 1, 49, 1, 50, 1, 51, 1, 52, 
-  1, 53, 1, 54, 1, 55, 1, 56, 1, 57, 1, 58, 1, 59, 1, 60, 1, 61, 1, 48, 
-  1, 63, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 
-  62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 
-  62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 
-  62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 
-  62, 62, 62, 62, 62, 62, 62, 1, 62, 65, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 
-  64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 
-  64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 
-  64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 
-  64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 66, 64, 67, 1, 68, 
-  1, 69, 1, 70, 1, 1, 1, 1, 1, 1, 1, 1, 71, 1, 72, 1, 73, 1, 1, 1, 
-  1, 74, 1, 1, 1, 1, 75, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 76, 1, 77, 
-  1, 78, 1, 79, 1, 80, 1, 82, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 
-  81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 
-  81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 
-  81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 
-  81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 1, 81, 82, 81, 81, 81, 81, 
-  81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 
-  81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 
-  81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 
-  81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 
-  81, 83, 81, 69, 83, 84, 1, 85, 1, 86, 1, 87, 1, 88, 1, 89, 1, 90, 1, 91, 
-  1, 92, 1, 93, 1, 83, 1, 94, 1, 95, 1, 96, 1, 97, 1, 98, 1, 99, 1, 73, 
-  1, 101, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 
-  100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 
-  100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 
-  100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 
-  100, 100, 100, 100, 100, 100, 100, 1, 100, 103, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 
-  102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 
-  102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 
-  102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 
-  102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 104, 102, 105, 83, 106, 
-  71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
-  71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
-  71, 71, 71, 71, 71, 71, 71, 71, 107, 71, 108, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
-  71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 
-  71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 107, 
-  71, 109, 1, 110, 1, 111, 1, 112, 1, 113, 1, 114, 1, 115, 1, 116, 1, 117, 1, 118, 
-  1, 119, 1, 120, 1, 121, 1, 122, 1, 123, 1, 124, 1, 125, 1, 126, 1, 127, 1, 128, 
-  1, 129, 1, 131, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-  130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-  130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-  130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-  130, 130, 130, 130, 130, 130, 130, 130, 130, 1, 130, 131, 130, 130, 130, 130, 130, 130, 130, 130, 
-  130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-  130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-  130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-  130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 132, 130, 6, 
-  1, 133, 1, 134, 1, 135, 1, 136, 1, 137, 1, 138, 1, 139, 1, 140, 1, 141, 1, 142, 
-  1, 143, 1, 144, 1, 146, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 
-  145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 
-  145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 
-  145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 
-  145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 1, 145, 148, 147, 147, 147, 147, 147, 147, 
-  147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 
-  147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 
-  147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 
-  147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 149, 
-  147, 150, 1, 151, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 152, 1, 153, 151, 151, 151, 151, 151, 151, 151, 151, 
-  151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 
-  151, 151, 154, 151, 155, 1, 152, 1, 156, 1, 157, 1, 158, 1, 159, 1, 160, 1, 161, 1, 
-  162, 1, 163, 1, 1, 1, 1, 1, 164, 1, 1, 165, 165, 165, 165, 165, 165, 165, 165, 165, 
-  165, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
-  1, 166, 1, 168, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 
-  167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 169, 167, 167, 167, 167, 167, 167, 167, 
-  167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 
-  167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 
-  167, 167, 167, 167, 167, 170, 167, 172, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 
-  171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 173, 171, 171, 171, 
-  171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 
-  171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 
-  171, 171, 171, 171, 171, 171, 171, 171, 171, 174, 171, 175, 1, 1, 176, 1, 161, 1, 1, 1, 
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 177, 1, 178, 1, 1, 1, 1, 1, 1, 
-  163, 1, 1, 1, 1, 1, 164, 1, 1, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 1, 
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 166, 
-  1, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 1, 180, 1, 1, 181, 1, 182, 1, 179, 
-  179, 179, 179, 179, 179, 179, 179, 179, 179, 1, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 
-  1, 180, 1, 1, 181, 1, 1, 1, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 1, 184, 
-  1, 185, 1, 186, 1, 171, 1, 1, 171, 1, 171, 1, 1, 1, 1, 1, 1, 1, 1, 171, 
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
-  1, 171, 1, 171, 1, 1, 171, 1, 1, 171, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
-  1, 171, 1, 1, 1, 171, 1, 171, 1, 187, 1, 188, 1, 189, 1, 190, 1, 191, 1, 192, 
-  1, 193, 1, 194, 1, 195, 1, 196, 1, 197, 1, 198, 1, 200, 199, 199, 199, 199, 199, 199, 
-  199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 
-  199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 
-  199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 
-  199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 1, 
-  199, 200, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 
-  199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 
-  199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 
-  199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 
-  199, 199, 199, 199, 199, 199, 199, 201, 199, 202, 1, 203, 1, 204, 1, 205, 1, 206, 1, 132, 
-  1, 207, 1, 208, 1, 209, 1, 210, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 
-  209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 
-  209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 211, 209, 2, 209, 
-  209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 
-  209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 
-  209, 209, 209, 209, 209, 209, 209, 211, 209, 212, 1, 1, 1, 1, 213, 1, 214, 1, 215, 1, 
-  216, 1, 217, 1, 218, 1, 219, 1, 220, 1, 221, 1, 222, 1, 223, 1, 132, 1, 127, 1, 
-  6, 2, 6, 6, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
-  1, 1, 1, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 224, 1, 225, 1, 
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, 1, 1, 1, 1, 1, 1, 1, 226, 227, 
+  0, 1, 2, 0, 3, 1, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3,
+  4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 3, 3, 3, 6, 3, 7,
+  1, 8, 1, 9, 1, 10, 1, 11, 1, 12, 1, 13, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 1, 1, 1, 1, 1, 1, 14, 1, 15, 1, 16, 1, 17, 1, 18, 1, 19, 1, 20,
+  1, 21, 1, 22, 23, 22, 22, 22, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 1, 1, 1, 1, 1, 22, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 24,
+  1, 25, 1, 22, 23, 22, 22, 22, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 1, 1, 1, 1, 1, 22, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 24,
+  1, 25, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 26, 1, 27, 1, 23, 27, 28, 1, 29, 28,
+  28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+  28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 30, 28, 29, 28, 28, 28, 28, 28, 28, 28,
+  28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+  28, 28, 28, 28, 30, 28, 28, 28, 28, 22, 28, 32, 31, 31, 31, 31, 31, 31, 31, 31,
+  31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+  31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+  31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+  31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 1, 31, 32,
+  31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+  31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+  31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+  31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+  31, 31, 31, 31, 31, 33, 31, 34, 35, 34, 34, 34, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 34, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 1, 1, 36, 1, 37, 1, 34, 35, 34, 34, 34, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 34, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 1, 1, 36, 1, 37, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, 1, 38,
+  1, 35, 38, 39, 1, 40, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
+  39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 41, 39, 40,
+  39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
+  39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 41, 39, 39, 39, 39, 34, 39, 42, 1,
+  43, 1, 44, 1, 45, 1, 46, 1, 47, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 48, 1, 49, 1, 50, 1, 51, 1, 52,
+  1, 53, 1, 54, 1, 55, 1, 56, 1, 57, 1, 58, 1, 59, 1, 60, 1, 61, 1, 48,
+  1, 63, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
+  62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
+  62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
+  62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
+  62, 62, 62, 62, 62, 62, 62, 1, 62, 65, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+  64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+  64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+  64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+  64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 66, 64, 67, 1, 68,
+  1, 69, 1, 70, 1, 1, 1, 1, 1, 1, 1, 1, 71, 1, 72, 1, 73, 1, 1, 1,
+  1, 74, 1, 1, 1, 1, 75, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 76, 1, 77,
+  1, 78, 1, 79, 1, 80, 1, 82, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+  81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+  81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+  81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+  81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 1, 81, 82, 81, 81, 81, 81,
+  81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+  81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+  81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+  81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+  81, 83, 81, 69, 83, 84, 1, 85, 1, 86, 1, 87, 1, 88, 1, 89, 1, 90, 1, 91,
+  1, 92, 1, 93, 1, 83, 1, 94, 1, 95, 1, 96, 1, 97, 1, 98, 1, 99, 1, 73,
+  1, 101, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+  100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+  100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+  100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
+  100, 100, 100, 100, 100, 100, 100, 1, 100, 103, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
+  102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
+  102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
+  102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
+  102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 104, 102, 105, 83, 106,
+  71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
+  71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
+  71, 71, 71, 71, 71, 71, 71, 71, 107, 71, 108, 71, 71, 71, 71, 71, 71, 71, 71, 71,
+  71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
+  71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 107,
+  71, 109, 1, 110, 1, 111, 1, 112, 1, 113, 1, 114, 1, 115, 1, 116, 1, 117, 1, 118,
+  1, 119, 1, 120, 1, 121, 1, 122, 1, 123, 1, 124, 1, 125, 1, 126, 1, 127, 1, 128,
+  1, 129, 1, 131, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
+  130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
+  130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
+  130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
+  130, 130, 130, 130, 130, 130, 130, 130, 130, 1, 130, 131, 130, 130, 130, 130, 130, 130, 130, 130,
+  130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
+  130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
+  130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
+  130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 132, 130, 6,
+  1, 133, 1, 134, 1, 135, 1, 136, 1, 137, 1, 138, 1, 139, 1, 140, 1, 141, 1, 142,
+  1, 143, 1, 144, 1, 146, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
+  145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
+  145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
+  145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
+  145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 1, 145, 148, 147, 147, 147, 147, 147, 147,
+  147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
+  147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
+  147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
+  147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 149,
+  147, 150, 1, 151, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 152, 1, 153, 151, 151, 151, 151, 151, 151, 151, 151,
+  151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151,
+  151, 151, 154, 151, 155, 1, 152, 1, 156, 1, 157, 1, 158, 1, 159, 1, 160, 1, 161, 1,
+  162, 1, 163, 1, 1, 1, 1, 1, 164, 1, 1, 165, 165, 165, 165, 165, 165, 165, 165, 165,
+  165, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 166, 1, 168, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167,
+  167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 169, 167, 167, 167, 167, 167, 167, 167,
+  167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167,
+  167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167,
+  167, 167, 167, 167, 167, 170, 167, 172, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
+  171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 173, 171, 171, 171,
+  171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
+  171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
+  171, 171, 171, 171, 171, 171, 171, 171, 171, 174, 171, 175, 1, 1, 176, 1, 161, 1, 1, 1,
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 177, 1, 178, 1, 1, 1, 1, 1, 1,
+  163, 1, 1, 1, 1, 1, 164, 1, 1, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 1,
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 166,
+  1, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 1, 180, 1, 1, 181, 1, 182, 1, 179,
+  179, 179, 179, 179, 179, 179, 179, 179, 179, 1, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183,
+  1, 180, 1, 1, 181, 1, 1, 1, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 1, 184,
+  1, 185, 1, 186, 1, 171, 1, 1, 171, 1, 171, 1, 1, 1, 1, 1, 1, 1, 1, 171,
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 171, 1, 171, 1, 1, 171, 1, 1, 171, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 171, 1, 1, 1, 171, 1, 171, 1, 187, 1, 188, 1, 189, 1, 190, 1, 191, 1, 192,
+  1, 193, 1, 194, 1, 195, 1, 196, 1, 197, 1, 198, 1, 200, 199, 199, 199, 199, 199, 199,
+  199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
+  199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
+  199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
+  199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 1,
+  199, 200, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
+  199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
+  199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
+  199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
+  199, 199, 199, 199, 199, 199, 199, 201, 199, 202, 1, 203, 1, 204, 1, 205, 1, 206, 1, 132,
+  1, 207, 1, 208, 1, 209, 1, 210, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
+  209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
+  209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 211, 209, 2, 209,
+  209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
+  209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
+  209, 209, 209, 209, 209, 209, 209, 211, 209, 212, 1, 1, 1, 1, 213, 1, 214, 1, 215, 1,
+  216, 1, 217, 1, 218, 1, 219, 1, 220, 1, 221, 1, 222, 1, 223, 1, 132, 1, 127, 1,
+  6, 2, 6, 6, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 1, 1, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 224, 1, 225, 1,
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, 1, 1, 1, 1, 1, 1, 1, 226, 227,
   1, 1, 1, 1, 228, 1, 1, 229, 1, 1, 1, 1, 1, 1, 230, 1, 231, 1, 0
 };
 
 local _parse_sql_trans_targs = { [0] =
-  2, 0, 196, 4, 4, 5, 196, 7, 8, 9, 10, 11, 12, 13, 36, 14, 15, 16, 17, 18, 
-  19, 20, 21, 21, 22, 24, 27, 23, 25, 25, 26, 28, 28, 29, 30, 30, 31, 33, 32, 34, 
-  34, 35, 37, 38, 39, 40, 41, 42, 56, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 
-  54, 55, 57, 57, 57, 57, 58, 59, 60, 61, 62, 92, 63, 64, 71, 82, 89, 65, 66, 67, 
-  68, 69, 69, 70, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 83, 84, 85, 86, 87, 88, 
-  90, 90, 90, 90, 91, 70, 92, 93, 196, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 
-  106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 116, 117, 119, 120, 121, 122, 123, 124, 125, 
-  126, 127, 128, 129, 130, 131, 131, 131, 131, 132, 133, 134, 137, 134, 135, 136, 138, 139, 140, 141, 
-  142, 143, 144, 145, 150, 151, 154, 146, 146, 147, 157, 146, 146, 147, 157, 148, 149, 196, 144, 151, 
-  148, 149, 152, 153, 155, 156, 147, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 
-  171, 172, 173, 174, 175, 176, 177, 179, 180, 181, 181, 182, 184, 195, 185, 186, 187, 188, 189, 190, 
+  2, 0, 196, 4, 4, 5, 196, 7, 8, 9, 10, 11, 12, 13, 36, 14, 15, 16, 17, 18,
+  19, 20, 21, 21, 22, 24, 27, 23, 25, 25, 26, 28, 28, 29, 30, 30, 31, 33, 32, 34,
+  34, 35, 37, 38, 39, 40, 41, 42, 56, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
+  54, 55, 57, 57, 57, 57, 58, 59, 60, 61, 62, 92, 63, 64, 71, 82, 89, 65, 66, 67,
+  68, 69, 69, 70, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 83, 84, 85, 86, 87, 88,
+  90, 90, 90, 90, 91, 70, 92, 93, 196, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105,
+  106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 116, 117, 119, 120, 121, 122, 123, 124, 125,
+  126, 127, 128, 129, 130, 131, 131, 131, 131, 132, 133, 134, 137, 134, 135, 136, 138, 139, 140, 141,
+  142, 143, 144, 145, 150, 151, 154, 146, 146, 147, 157, 146, 146, 147, 157, 148, 149, 196, 144, 151,
+  148, 149, 152, 153, 155, 156, 147, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171,
+  171, 172, 173, 174, 175, 176, 177, 179, 180, 181, 181, 182, 184, 195, 185, 186, 187, 188, 189, 190,
   191, 192, 193, 194, 1, 3, 6, 94, 118, 158, 178, 183
 };
 
 local _parse_sql_trans_actions = { [0] =
-  1, 0, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
-  1, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 3, 1, 1, 3, 1, 1, 1, 1, 
-  3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
-  1, 1, 5, 20, 1, 3, 30, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
-  1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
-  5, 20, 1, 3, 26, 3, 3, 1, 23, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
-  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 
-  1, 1, 1, 1, 1, 5, 20, 1, 3, 42, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 
-  1, 1, 11, 1, 5, 5, 1, 5, 20, 46, 5, 1, 3, 34, 1, 14, 1, 17, 1, 1, 
-  51, 38, 1, 1, 1, 1, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
-  3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
+  1, 0, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 3, 1, 1, 3, 1, 1, 1, 1,
+  3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 1, 5, 20, 1, 3, 30, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+  5, 20, 1, 3, 26, 3, 3, 1, 23, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 1, 1, 1, 1, 5, 20, 1, 3, 42, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1,
+  1, 1, 11, 1, 5, 5, 1, 5, 20, 46, 5, 1, 3, 34, 1, 14, 1, 17, 1, 1,
+  51, 38, 1, 1, 1, 1, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+  3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1,
   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
 };
 
@@ -277,7 +277,7 @@ function parse_sql(data, h)
        local mark, token;
        local table_name, columns, value_lists, value_list, value_count;
 
-       
+
   cs = parse_sql_start;
 
 --  ragel flat exec
@@ -322,10 +322,10 @@ function parse_sql(data, h)
       _inds = _parse_sql_index_offsets[cs];
       _slen = _parse_sql_key_spans[cs];
 
-      if   _slen > 0 and 
-         _parse_sql_trans_keys[_keys] <= data:byte(p) and 
-         data:byte(p) <= _parse_sql_trans_keys[_keys + 1] then 
-        _trans = _parse_sql_indicies[ _inds + data:byte(p) - _parse_sql_trans_keys[_keys] ]; 
+      if   _slen > 0 and
+         _parse_sql_trans_keys[_keys] <= data:byte(p) and
+         data:byte(p) <= _parse_sql_trans_keys[_keys + 1] then
+        _trans = _parse_sql_indicies[ _inds + data:byte(p) - _parse_sql_trans_keys[_keys] ];
       else _trans =_parse_sql_indicies[ _inds + _slen ]; end
 
     cs = _parse_sql_trans_targs[_trans];
@@ -364,7 +364,7 @@ function parse_sql(data, h)
        h.create(table_name, columns);       -- ACTION
         elseif _tempval  == 7 then --4 FROM_STATE_ACTION_SWITCH
 -- line 65 "sql.rl" -- end of line directive
-      
+
                        value_count = value_count + 1; value_list[value_count] = token:gsub("\\.", _sql_unescapes);
                      -- ACTION
         elseif _tempval  == 8 then --4 FROM_STATE_ACTION_SWITCH
@@ -392,7 +392,7 @@ function parse_sql(data, h)
     end
 
     if _trigger_goto then _continue = true; break; end
-    end -- endif 
+    end -- endif
 
     if _goto_level <= _again then
       if cs == 0 then
index 27b5835e81cb7ae5a1170f7816d66f425bc21964..180ae910725cf38d32852310bdd8875563da3afd 100644 (file)
@@ -24,7 +24,7 @@ local function create_table(connection, params)
        elseif params.driver == "MySQL" then
                create_sql = create_sql:gsub("`value` TEXT", "`value` MEDIUMTEXT");
        end
-       
+
        local stmt = connection:prepare(create_sql);
        if stmt then
                local ok = stmt:execute();
index 7c933b88118a748cc43f82f01872895b0ce3518a..b86e9892a0da9630637496c35614ea2f5ce32586 100644 (file)
@@ -115,7 +115,7 @@ if have_err then
        print("");
        os.exit(1);
 end
-       
+
 local itype = config[from_store].type;
 local otype = config[to_store].type;
 local reader = require("migrator."..itype).reader(config[from_store]);
index 5ef47602a9b3b7254ef82accbbb7e3fc74ba76ee..cd3e62e5d850ed8b71c35fd8e7c2e11c39163fc6 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/env lua
 -- Prosody IM
 -- Copyright (C) 2008-2009 Waqas Hussain
--- 
+--
 -- This project is MIT/X11 licensed. Please see the
 -- COPYING file in the source package for more information.
 --
index 0862b0c14ea6a536e65f00114c8fabe00223b51f..e95a9d5953a5eed91a7de30d7fd4eea0d489dc97 100755 (executable)
@@ -3,7 +3,7 @@
 -- Copyright (C) 2008-2009 Matthew Wild
 -- Copyright (C) 2008-2009 Waqas Hussain
 -- Copyright (C) 2010      Stefan Gehn
--- 
+--
 -- This project is MIT/X11 licensed. Please see the
 -- COPYING file in the source package for more information.
 --
index 2d58e7fb72d623169faa0deeada3dac881154462..9bf215af72c9d73b0b09e1fb31ccaf95fa8a6f4a 100644 (file)
@@ -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.
 --
@@ -59,13 +59,13 @@ function array_base.filter(outa, ina, func)
                        write = write + 1;
                end
        end
-       
+
        if inplace and write <= start_length then
                for i=write,start_length do
                        outa[i] = nil;
                end
        end
-       
+
        return outa;
 end
 
index a61e740375048b406b608a7a79f3e8b1365d9e10..4723b912942e6606ccf59679e087c87c09b7597c 100644 (file)
@@ -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.
 --
index 52924841a0dc4fcc98907ed2eb96f9891c1cdbfe..b38d0e274373c3923ad11cdd30a336b73f05e40f 100644 (file)
@@ -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.
 --
@@ -38,7 +38,7 @@ function form_t.form(layout, data, formtype)
                form:tag("field", { type = field_type, var = field.name, label = field.label });
 
                local value = (data and data[field.name]) or field.value;
-               
+
                if value then
                        -- Add value, depending on type
                        if field_type == "hidden" then
@@ -93,11 +93,11 @@ function form_t.form(layout, data, formtype)
                                end
                        end
                end
-               
+
                if field.required then
                        form:tag("required"):up();
                end
-               
+
                -- Jump back up to list of fields
                form:up();
        end
index a1f62a48563ed48fc2d30c5c1f5e8b94c66e0e17..dd596527c4325c050d4d7c11eedb602cb3f272d3 100644 (file)
@@ -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.
 --
index bff0e347a22fa7b58676e280484c9e017bc8f24b..1f1ec9df1709e461c8444bc7ff9d3a1bee7f51f7 100644 (file)
@@ -93,14 +93,14 @@ function get_traceback_table(thread, start_level)
                        info = debug.getinfo(level+1);
                end
                if not info then break; end
-               
+
                levels[(level-start_level)+1] = {
                        level = level;
                        info = info;
                        locals = get_locals_table(level+1);
                        upvalues = get_upvalues_table(info.func);
                };
-       end     
+       end
        return levels;
 end
 
@@ -137,12 +137,12 @@ function _traceback(thread, message, level)
        level = level or 1;
 
        message = message and (message.."\n") or "";
-       
+
        -- +3 counts for this function, and the pcall() and wrapper above us
        local levels = get_traceback_table(thread, level+3);
-       
+
        local last_source_desc;
-       
+
        local lines = {};
        for nlevel, level in ipairs(levels) do
                local info = level.info;
index 53d2719d515829a454ec5bf4f96417ba95f232fd..109a3332e9180c50dcc0915cd4d3af0d53340584 100644 (file)
@@ -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.
 --
@@ -35,7 +35,7 @@ function missingdep(name, sources, msg)
        print("");
 end
 
--- COMPAT w/pre-0.8 Debian: The Debian config file used to use 
+-- COMPAT w/pre-0.8 Debian: The Debian config file used to use
 -- util.ztact, which has been removed from Prosody in 0.8. This
 -- is to log an error for people who still use it, so they can
 -- update their configs.
@@ -50,9 +50,9 @@ end;
 
 function check_dependencies()
        local fatal;
-       
+
        local lxp = softreq "lxp"
-       
+
        if not lxp then
                missingdep("luaexpat", {
                                ["Debian/Ubuntu"] = "sudo apt-get install liblua5.1-expat0";
@@ -61,9 +61,9 @@ function check_dependencies()
                        });
                fatal = true;
        end
-       
+
        local socket = softreq "socket"
-       
+
        if not socket then
                missingdep("luasocket", {
                                ["Debian/Ubuntu"] = "sudo apt-get install liblua5.1-socket2";
@@ -72,7 +72,7 @@ function check_dependencies()
                        });
                fatal = true;
        end
-       
+
        local lfs, err = softreq "lfs"
        if not lfs then
                missingdep("luafilesystem", {
@@ -82,9 +82,9 @@ function check_dependencies()
                        });
                fatal = true;
        end
-       
+
        local ssl = softreq "ssl"
-       
+
        if not ssl then
                missingdep("LuaSec", {
                                ["Debian/Ubuntu"] = "http://prosody.im/download/start#debian_and_ubuntu";
@@ -92,7 +92,7 @@ function check_dependencies()
                                ["Source"] = "http://www.inf.puc-rio.br/~brunoos/luasec/";
                        }, "SSL/TLS support will not be available");
        end
-       
+
        local encodings, err = softreq "util.encodings"
        if not encodings then
                if err:match("not found") then
index 4ace026f2cda858b7058d127127ae4b77cb0bb7c..40ca39131240c2f9c906021e3fe5a6886361a01d 100644 (file)
@@ -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.
 --
index d143666bf8d8f212225d475cdc8312317e746ad4..8a470011fe4b688b6bd7259fc084098ab00f2c86 100644 (file)
@@ -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.
 --
@@ -16,7 +16,7 @@ function initialize(session)
        if not session.filters then
                local filters = {};
                session.filters = filters;
-               
+
                function session.filter(type, data)
                        local filter_list = filters[type];
                        if filter_list then
@@ -28,11 +28,11 @@ function initialize(session)
                        return data;
                end
        end
-       
+
        for i=1,#new_filter_hooks do
                new_filter_hooks[i](session);
        end
-       
+
        return session.filter;
 end
 
@@ -40,20 +40,20 @@ function add_filter(session, type, callback, priority)
        if not session.filters then
                initialize(session);
        end
-       
+
        local filter_list = session.filters[type];
        if not filter_list then
                filter_list = {};
                session.filters[type] = filter_list;
        end
-       
+
        priority = priority or 0;
-       
+
        local i = 0;
        repeat
                i = i + 1;
        until not filter_list[i] or filter_list[filter_list[i]] >= priority;
-       
+
        t_insert(filter_list, i, callback);
        filter_list[callback] = priority;
 end
index 08b86a7c0907ee462af619f11e982dc73afae6ef..437a920c102371eb4130384e825af9a7fbabb25b 100644 (file)
@@ -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.
 --
index 51211c7a2fe52aa23f9d2c4814cb4287c368579f..2c4cc6ef549de995611665505d38eada12ecae18 100644 (file)
@@ -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.
 --
index 81401e8b503a0433c7382cd99cda9e13342cf2ae..174da0cacace435b145bde85935e9631eacd7fc4 100644 (file)
@@ -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.
 --
index 62649c9b8567d6afe1aacc85d0aa91b7948245db..d0ae07eb8aa3c57cd18e178b20ff10c391d0ed4b 100644 (file)
@@ -92,7 +92,7 @@ local function v6scope(ip)
        if ip:match("^[0:]*1$") then
                return 0x2;
        -- Link-local unicast:
-       elseif ip:match("^[Ff][Ee][89ABab]") then 
+       elseif ip:match("^[Ff][Ee][89ABab]") then
                return 0x2;
        -- Site-local unicast:
        elseif ip:match("^[Ff][Ee][CcDdEeFf]") then
index 4b429163bfbdbcf963cf0d267c1d3da7b1015ac7..aa9c3ec06a2756c404a2f5a6b1a60e6b81469bd6 100644 (file)
@@ -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.
 --
@@ -25,7 +25,7 @@ function it.reverse(f, s, var)
                if var == nil then break; end
                t_insert(results, 1, ret);
        end
-       
+
        -- Then return our reverse one
        local i,max = 0, #results;
        return function (results)
@@ -56,7 +56,7 @@ end
 -- Given an iterator, iterate only over unique items
 function it.unique(f, s, var)
        local set = {};
-       
+
        return function ()
                while true do
                        local ret = pack(f(s, var));
@@ -73,13 +73,13 @@ end
 --[[ Return the number of items an iterator returns ]]--
 function it.count(f, s, var)
        local x = 0;
-       
+
        while true do
                var = f(s, var);
                if var == nil then break; end
                x = x + 1;
        end
-       
+
        return x;
 end
 
index 4c4371d805361006d87b842f3ebd55f646709eca..0d9a864fa3b1d8a4faa5e747a96c30a1c47e20a9 100644 (file)
@@ -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.
 --
index 82ebcc4330ef61e56f3185f9cbd75a4f7554500c..a8a58afcd12062267cf63414d905e9d6c75c75bc 100644 (file)
@@ -348,9 +348,9 @@ local first_escape = {
 function json.decode(json)
        json = json:gsub("\\.", first_escape) -- get rid of all escapes except \uXXXX, making string parsing much simpler
                --:gsub("[\r\n]", "\t"); -- \r\n\t are equivalent, we care about none of them, and none of them can be in strings
-       
+
        -- TODO do encoding verification
-       
+
        local val, index = _readvalue(json, 1);
        if val == nil then return val, index; end
        if json:find("[^ \t\r\n]", index) then return nil, "garbage at eof"; end
index 26206d4d83379ff49b255372197c1fb891337f50..cd0769f9230fec3a7645088a5a1a959ad5470582 100644 (file)
@@ -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.
 --
index dbf34d28ff33e4ba8c453270f2b751eeda128066..caf25118e3f622ecd66dbea06b5c24de7abba968 100644 (file)
@@ -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.
 --
index c10fdf6525ae2e34868a5bf8bf90c3104664d920..b894f5279dae89d5497482edc77528ec6e285451 100644 (file)
@@ -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.
 --
index b80a69f26eaafab55be94e4a2b47b65130e9818a..fe862114535bcc44c21906b3514249bbc90cf861 100644 (file)
@@ -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.
 --
@@ -146,7 +146,7 @@ function adduser(params)
        if not(provider) or provider.name == "null" then
                usermanager.initialize_host(host);
        end
-       
+
        local ok, errmsg = usermanager.create_user(user, password, host);
        if not ok then
                return false, errmsg;
@@ -162,7 +162,7 @@ function user_exists(params)
        if not(provider) or provider.name == "null" then
                usermanager.initialize_host(host);
        end
-       
+
        return usermanager.user_exists(user, host);
 end
 
@@ -170,7 +170,7 @@ function passwd(params)
        if not _M.user_exists(params) then
                return false, "no-such-user";
        end
-       
+
        return _M.adduser(params);
 end
 
@@ -179,7 +179,7 @@ function deluser(params)
                return false, "no-such-user";
        end
        local user, host = nodeprep(params.user), nameprep(params.host);
-       
+
        return usermanager.delete_user(user, host);
 end
 
@@ -188,30 +188,30 @@ function getpid()
        if not pidfile then
                return false, "no-pidfile";
        end
-       
+
        local modules_enabled = set.new(config.get("*", "modules_enabled"));
        if not modules_enabled:contains("posix") then
                return false, "no-posix";
        end
-       
+
        local file, err = io.open(pidfile, "r+");
        if not file then
                return false, "pidfile-read-failed", err;
        end
-       
+
        local locked, err = lfs.lock(file, "w");
        if locked then
                file:close();
                return false, "pidfile-not-locked";
        end
-       
+
        local pid = tonumber(file:read("*a"));
        file:close();
-       
+
        if not pid then
                return false, "invalid-pid";
        end
-       
+
        return true, pid;
 end
 
@@ -252,10 +252,10 @@ function stop()
        if not ret then
                return false, "not-running";
        end
-       
+
        local ok, pid = _M.getpid()
        if not ok then return false, pid; end
-       
+
        signal.kill(pid, signal.SIGTERM);
        return true;
 end
@@ -268,10 +268,10 @@ function reload()
        if not ret then
                return false, "not-running";
        end
-       
+
        local ok, pid = _M.getpid()
        if not ok then return false, pid; end
-       
+
        signal.kill(pid, signal.SIGHUP);
        return true;
 end
index e1418c62d51fdccf96b4f8605789ce0378e11a9e..0dfd196b2db22b5ef08545febaeca4b51b4b7aa0 100644 (file)
@@ -29,13 +29,13 @@ end
 
 function service:may(node, actor, action)
        if actor == true then return true; end
-       
+
        local node_obj = self.nodes[node];
        local node_aff = node_obj and node_obj.affiliations[actor];
        local service_aff = self.affiliations[actor]
                         or self.config.get_affiliation(actor, node, action)
                         or "none";
-       
+
        -- Check if node allows/forbids it
        local node_capabilities = node_obj and node_obj.capabilities;
        if node_capabilities then
@@ -47,7 +47,7 @@ function service:may(node, actor, action)
                        end
                end
        end
-       
+
        -- Check service-wide capabilities instead
        local service_capabilities = self.config.capabilities;
        local caps = service_capabilities[node_aff or service_aff];
@@ -57,7 +57,7 @@ function service:may(node, actor, action)
                        return can;
                end
        end
-       
+
        return false;
 end
 
@@ -211,7 +211,7 @@ function service:create(node, actor)
        if self.nodes[node] then
                return false, "conflict";
        end
-       
+
        self.nodes[node] = {
                name = node;
                subscribers = {};
index cf2f0ede940c3e8eb3696192487efe2b80848c9d..31c078a0513a3fbb4880d8f460a4c757640aea52 100644 (file)
@@ -73,11 +73,11 @@ local function validate_username(username, _nodeprep)
                        return false
                end
        end
-       
+
        -- replace =2C with , and =3D with =
        username = username:gsub("=2C", ",");
        username = username:gsub("=3D", "=");
-       
+
        -- apply SASLprep
        username = saslprep(username);
 
@@ -108,12 +108,12 @@ end
 local function scram_gen(hash_name, H_f, HMAC_f)
        local function scram_hash(self, message)
                if not self.state then self["state"] = {} end
-       
+
                if type(message) ~= "string" or #message == 0 then return "failure", "malformed-request" end
                if not self.state.name then
                        -- we are processing client_first_message
                        local client_first_message = message;
-                       
+
                        -- TODO: fail if authzid is provided, since we don't support them yet
                        self.state["client_first_message"] = client_first_message;
                        self.state["gs2_cbind_flag"], self.state["authzid"], self.state["name"], self.state["clientnonce"]
@@ -127,21 +127,21 @@ local function scram_gen(hash_name, H_f, HMAC_f)
                        if not self.state.name or not self.state.clientnonce then
                                return "failure", "malformed-request", "Channel binding isn't support at this time.";
                        end
-               
+
                        self.state.name = validate_username(self.state.name, self.profile.nodeprep);
                        if not self.state.name then
                                log("debug", "Username violates either SASLprep or contains forbidden character sequences.")
                                return "failure", "malformed-request", "Invalid username.";
                        end
-               
+
                        self.state["servernonce"] = generate_uuid();
-                       
+
                        -- retreive credentials
                        if self.profile.plain then
                                local password, state = self.profile.plain(self, self.state.name, self.realm)
                                if state == nil then return "failure", "not-authorized"
                                elseif state == false then return "failure", "account-disabled" end
-                               
+
                                password = saslprep(password);
                                if not password then
                                        log("debug", "Password violates SASLprep.");
@@ -161,22 +161,22 @@ local function scram_gen(hash_name, H_f, HMAC_f)
                                local stored_key, server_key, iteration_count, salt, state = self.profile["scram_"..hashprep(hash_name)](self, self.state.name, self.realm);
                                if state == nil then return "failure", "not-authorized"
                                elseif state == false then return "failure", "account-disabled" end
-                               
+
                                self.state.stored_key = stored_key;
                                self.state.server_key = server_key;
                                self.state.iteration_count = iteration_count;
                                self.state.salt = salt
                        end
-               
+
                        local server_first_message = "r="..self.state.clientnonce..self.state.servernonce..",s="..base64.encode(self.state.salt)..",i="..self.state.iteration_count;
                        self.state["server_first_message"] = server_first_message;
                        return "challenge", server_first_message
                else
                        -- we are processing client_final_message
                        local client_final_message = message;
-                       
+
                        self.state["channelbinding"], self.state["nonce"], self.state["proof"] = client_final_message:match("^c=(.*),r=(.*),.*p=(.*)");
-       
+
                        if not self.state.proof or not self.state.nonce or not self.state.channelbinding then
                                return "failure", "malformed-request", "Missing an attribute(p, r or c) in SASL message.";
                        end
@@ -184,10 +184,10 @@ local function scram_gen(hash_name, H_f, HMAC_f)
                        if self.state.nonce ~= self.state.clientnonce..self.state.servernonce then
                                return "failure", "malformed-request", "Wrong nonce in client-final-message.";
                        end
-                       
+
                        local ServerKey = self.state.server_key;
                        local StoredKey = self.state.stored_key;
-                       
+
                        local AuthMessage = "n=" .. s_match(self.state.client_first_message,"n=(.+)") .. "," .. self.state.server_first_message .. "," .. s_match(client_final_message, "(.+),p=.+")
                        local ClientSignature = HMAC_f(StoredKey, AuthMessage)
                        local ClientKey = binaryXOR(ClientSignature, base64.decode(self.state.proof))
index 196845876c84141b3c8a10a402ee5a3fae424559..a0e8bd69d45c4dde830efd2881a3a55efcdaf1b1 100644 (file)
@@ -78,10 +78,10 @@ local function init(service_name)
 end
 
 -- create a new SASL object which can be used to authenticate clients
--- host_fqdn may be nil in which case gethostname() gives the value. 
+-- host_fqdn may be nil in which case gethostname() gives the value.
 --      For GSSAPI, this determines the hostname in the service ticket (after
 --      reverse DNS canonicalization, only if [libdefaults] rdns = true which
---      is the default).  
+--      is the default).
 function new(realm, service_name, app_name, host_fqdn)
 
        init(app_name or service_name);
index 8a259184c61b715326b03d176e95a6e5d56e60fe..06e4505442dfc4934be8dd9fe20d42e122fddca6 100644 (file)
@@ -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.
 --
index 7f45526eb41f97741cfdabd8abc15f114442a0f1..e9dfec1bca729b509040e785248389187dca8abd 100644 (file)
@@ -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.
 --
@@ -40,13 +40,13 @@ function set_mt.__eq(set1, set2)
                        return false;
                end
        end
-       
+
        for item in pairs(set2) do
                if not set1[item] then
                        return false;
                end
        end
-       
+
        return true;
 end
 function set_mt.__tostring(set)
@@ -65,23 +65,23 @@ end
 function new(list)
        local items = setmetatable({}, items_mt);
        local set = { _items = items };
-       
+
        function set:add(item)
                items[item] = true;
        end
-       
+
        function set:contains(item)
                return items[item];
        end
-       
+
        function set:items()
                return items;
        end
-       
+
        function set:remove(item)
                items[item] = nil;
        end
-       
+
        function set:add_list(list)
                if list then
                        for _, item in ipairs(list) do
@@ -89,7 +89,7 @@ function new(list)
                        end
                end
        end
-       
+
        function set:include(otherset)
                for item in pairs(otherset) do
                        items[item] = true;
@@ -101,22 +101,22 @@ function new(list)
                        items[item] = nil;
                end
        end
-       
+
        function set:empty()
                return not next(items);
        end
-       
+
        if list then
                set:add_list(list);
        end
-       
+
        return setmetatable(set, set_mt);
 end
 
 function union(set1, set2)
        local set = new();
        local items = set._items;
-       
+
        for item in pairs(set1._items) do
                items[item] = true;
        end
@@ -124,14 +124,14 @@ function union(set1, set2)
        for item in pairs(set2._items) do
                items[item] = true;
        end
-       
+
        return set;
 end
 
 function difference(set1, set2)
        local set = new();
        local items = set._items;
-       
+
        for item in pairs(set1._items) do
                items[item] = (not set2._items[item]) or nil;
        end
@@ -142,13 +142,13 @@ end
 function intersection(set1, set2)
        local set = new();
        local items = set._items;
-       
+
        set1, set2 = set1._items, set2._items;
-       
+
        for item in pairs(set1) do
                items[item] = (not not set2[item]) or nil;
        end
-       
+
        return set;
 end
 
index 63c399ff1d027ab347255381cb32128bf6891dfa..b8c16e270637d71b13b47552cdc6c0cd77ea95d4 100644 (file)
@@ -45,7 +45,7 @@ function String(n) return "String()" end
 };
 
 local functions = {
-       
+
 };
 
 local cmap = {
index 7c21421083d57daafbcf2ad807c3d7b7166c36a5..82601e630986fc4376f22c714144bba267b27212 100644 (file)
@@ -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.
 --
@@ -99,7 +99,7 @@ function stanza_mt:get_child(name, xmlns)
                if (not name or child.name == name)
                        and ((not xmlns and self.attr.xmlns == child.attr.xmlns)
                                or child.attr.xmlns == xmlns) then
-                       
+
                        return child;
                end
        end
@@ -152,7 +152,7 @@ end
 function stanza_mt:maptags(callback)
        local tags, curr_tag = self.tags, 1;
        local n_children, n_tags = #self, #tags;
-       
+
        local i = 1;
        while curr_tag <= n_tags and n_tags > 0 do
                if self[i] == tags[curr_tag] then
@@ -258,13 +258,13 @@ end
 
 function stanza_mt.get_error(stanza)
        local type, condition, text;
-       
+
        local error_tag = stanza:get_child("error");
        if not error_tag then
                return nil, nil, nil;
        end
        type = error_tag.attr.type;
-       
+
        for _, child in ipairs(error_tag.tags) do
                if child.attr.xmlns == xmlns_stanzas then
                        if not text and child.name == "text" then
@@ -333,7 +333,7 @@ function deserialize(stanza)
                        stanza.tags = tags;
                end
        end
-       
+
        return stanza;
 end
 
@@ -390,7 +390,7 @@ if do_pretty_printing then
        local style_attrv = getstyle("red");
        local style_tagname = getstyle("red");
        local style_punc = getstyle("magenta");
-       
+
        local attr_format = " "..getstring(style_attrk, "%s")..getstring(style_punc, "=")..getstring(style_attrv, "'%s'");
        local top_tag_format = getstring(style_punc, "<")..getstring(style_tagname, "%s").."%s"..getstring(style_punc, ">");
        --local tag_format = getstring(style_punc, "<")..getstring(style_tagname, "%s").."%s"..getstring(style_punc, ">").."%s"..getstring(style_punc, "</")..getstring(style_tagname, "%s")..getstring(style_punc, ">");
@@ -411,7 +411,7 @@ if do_pretty_printing then
                end
                return s_format(tag_format, t.name, attr_string, children_text, t.name);
        end
-       
+
        function stanza_mt.pretty_top_tag(t)
                local attr_string = "";
                if t.attr then
index 6ef3b689e20dc893eb04c2970033bc97ec11d1f9..ef978364f93ff1ab35c1c348ed0d44d92d82188d 100644 (file)
@@ -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.
 --
index af1e57b6d176c487b47c5e2d94e40c4eddb08247..0e10e144e9746ed0f974be58605fb1fb43dc19ae 100644 (file)
@@ -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.
 --
@@ -42,7 +42,7 @@ if not server.event then
                        end
                        new_data = {};
                end
-               
+
                local next_time = math_huge;
                for i, d in pairs(data) do
                        local t, callback = d[1], d[2];
index 796c8ee4c47247dd049e6bb3561ab5223ced74bc..fc487c7283bcf4b3b364030faf28b28f25921fac 100644 (file)
@@ -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.
 --
index 076490faf8b9655daa940beb646c3cd6552e2b73..6dbed65d2f5b1c144890b17cec5511386a8643cd 100644 (file)
@@ -26,8 +26,8 @@ local parse_xml = (function()
                                attr[i] = nil;
                                local ns, nm = k:match(ns_pattern);
                                if nm ~= "" then
-                                       ns = ns_prefixes[ns]; 
-                                       if ns then 
+                                       ns = ns_prefixes[ns];
+                                       if ns then
                                                attr[ns..":"..nm] = attr[k];
                                                attr[k] = nil;
                                        end
index 4909678cefad306c8728ce5b027eec4ab091e106..550170c94c75d96118cf023be0fe9bcfaeaf093c 100644 (file)
@@ -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.
 --
@@ -42,21 +42,21 @@ _M.ns_pattern = ns_pattern;
 
 function new_sax_handlers(session, stream_callbacks)
        local xml_handlers = {};
-       
+
        local cb_streamopened = stream_callbacks.streamopened;
        local cb_streamclosed = stream_callbacks.streamclosed;
        local cb_error = stream_callbacks.error or function(session, e, stanza) error("XML stream error: "..tostring(e)..(stanza and ": "..tostring(stanza) or ""),2); end;
        local cb_handlestanza = stream_callbacks.handlestanza;
-       
+
        local stream_ns = stream_callbacks.stream_ns or xmlns_streams;
        local stream_tag = stream_callbacks.stream_tag or "stream";
        if stream_ns ~= "" then
                stream_tag = stream_ns..ns_separator..stream_tag;
        end
        local stream_error_tag = stream_ns..ns_separator..(stream_callbacks.error_tag or "error");
-       
+
        local stream_default_ns = stream_callbacks.default_ns;
-       
+
        local stack = {};
        local chardata, stanza = {};
        local non_streamns_depth = 0;
@@ -75,7 +75,7 @@ function new_sax_handlers(session, stream_callbacks)
                        attr.xmlns = curr_ns;
                        non_streamns_depth = non_streamns_depth + 1;
                end
-               
+
                for i=1,#attr do
                        local k = attr[i];
                        attr[i] = nil;
@@ -85,7 +85,7 @@ function new_sax_handlers(session, stream_callbacks)
                                attr[k] = nil;
                        end
                end
-               
+
                if not stanza then --if we are not currently inside a stanza
                        if session.notopen then
                                if tagname == stream_tag then
@@ -102,7 +102,7 @@ function new_sax_handlers(session, stream_callbacks)
                        if curr_ns == "jabber:client" and name ~= "iq" and name ~= "presence" and name ~= "message" then
                                cb_error(session, "invalid-top-level-element");
                        end
-                       
+
                        stanza = setmetatable({ name = name, attr = attr, tags = {} }, stanza_mt);
                else -- we are inside a stanza, so add a tag
                        t_insert(stack, stanza);
@@ -151,22 +151,22 @@ function new_sax_handlers(session, stream_callbacks)
                        error("Failed to abort parsing");
                end
        end
-       
+
        if lxp_supports_doctype then
                xml_handlers.StartDoctypeDecl = restricted_handler;
        end
        xml_handlers.Comment = restricted_handler;
        xml_handlers.ProcessingInstruction = restricted_handler;
-       
+
        local function reset()
                stanza, chardata = nil, {};
                stack = {};
        end
-       
+
        local function set_session(stream, new_session)
                session = new_session;
        end
-       
+
        return xml_handlers, { reset = reset, set_session = set_session };
 end