mirror of
https://github.com/bjc/prosody.git
synced 2025-04-03 05:07:42 +03:00
plugins: Prefix module imports with prosody namespace
This commit is contained in:
parent
8136aa749a
commit
98922d54b1
100 changed files with 499 additions and 499 deletions
|
@ -4,7 +4,7 @@
|
||||||
-- COPYING file in the source package for more information.
|
-- COPYING file in the source package for more information.
|
||||||
--
|
--
|
||||||
|
|
||||||
local st, uuid = require "util.stanza", require "util.uuid";
|
local st, uuid = require "prosody.util.stanza", require "prosody.util.uuid";
|
||||||
|
|
||||||
local xmlns_cmd = "http://jabber.org/protocol/commands";
|
local xmlns_cmd = "http://jabber.org/protocol/commands";
|
||||||
|
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
-- COPYING file in the source package for more information.
|
-- COPYING file in the source package for more information.
|
||||||
--
|
--
|
||||||
|
|
||||||
local it = require "util.iterators";
|
local it = require "prosody.util.iterators";
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local jid_host = require "util.jid".host;
|
local jid_host = require "prosody.util.jid".host;
|
||||||
local adhoc_handle_cmd = module:require "adhoc".handle_cmd;
|
local adhoc_handle_cmd = module:require "adhoc".handle_cmd;
|
||||||
local xmlns_cmd = "http://jabber.org/protocol/commands";
|
local xmlns_cmd = "http://jabber.org/protocol/commands";
|
||||||
local commands = {};
|
local commands = {};
|
||||||
|
|
|
@ -14,25 +14,25 @@ local t_sort = table.sort;
|
||||||
|
|
||||||
local module_host = module:get_host();
|
local module_host = module:get_host();
|
||||||
|
|
||||||
local keys = require "util.iterators".keys;
|
local keys = require "prosody.util.iterators".keys;
|
||||||
local usermanager_user_exists = require "core.usermanager".user_exists;
|
local usermanager_user_exists = require "prosody.core.usermanager".user_exists;
|
||||||
local usermanager_create_user = require "core.usermanager".create_user;
|
local usermanager_create_user = require "prosody.core.usermanager".create_user;
|
||||||
local usermanager_delete_user = require "core.usermanager".delete_user;
|
local usermanager_delete_user = require "prosody.core.usermanager".delete_user;
|
||||||
local usermanager_disable_user = require "core.usermanager".disable_user;
|
local usermanager_disable_user = require "prosody.core.usermanager".disable_user;
|
||||||
local usermanager_enable_user = require "core.usermanager".enable_user;
|
local usermanager_enable_user = require "prosody.core.usermanager".enable_user;
|
||||||
local usermanager_set_password = require "core.usermanager".set_password;
|
local usermanager_set_password = require "prosody.core.usermanager".set_password;
|
||||||
local hostmanager_activate = require "core.hostmanager".activate;
|
local hostmanager_activate = require "prosody.core.hostmanager".activate;
|
||||||
local hostmanager_deactivate = require "core.hostmanager".deactivate;
|
local hostmanager_deactivate = require "prosody.core.hostmanager".deactivate;
|
||||||
local rm_load_roster = require "core.rostermanager".load_roster;
|
local rm_load_roster = require "prosody.core.rostermanager".load_roster;
|
||||||
local st, jid = require "util.stanza", require "util.jid";
|
local st, jid = require "prosody.util.stanza", require "prosody.util.jid";
|
||||||
local timer_add_task = require "util.timer".add_task;
|
local timer_add_task = require "prosody.util.timer".add_task;
|
||||||
local dataforms_new = require "util.dataforms".new;
|
local dataforms_new = require "prosody.util.dataforms".new;
|
||||||
local array = require "util.array";
|
local array = require "prosody.util.array";
|
||||||
local modulemanager = require "core.modulemanager";
|
local modulemanager = require "prosody.core.modulemanager";
|
||||||
local core_post_stanza = prosody.core_post_stanza;
|
local core_post_stanza = prosody.core_post_stanza;
|
||||||
local adhoc_simple = require "util.adhoc".new_simple_form;
|
local adhoc_simple = require "prosody.util.adhoc".new_simple_form;
|
||||||
local adhoc_initial = require "util.adhoc".new_initial_data_form;
|
local adhoc_initial = require "prosody.util.adhoc".new_initial_data_form;
|
||||||
local set = require"util.set";
|
local set = require"prosody.util.set";
|
||||||
|
|
||||||
module:depends("adhoc");
|
module:depends("adhoc");
|
||||||
local adhoc_new = module:require "adhoc".new;
|
local adhoc_new = module:require "adhoc".new;
|
||||||
|
|
|
@ -10,39 +10,39 @@
|
||||||
module:set_global();
|
module:set_global();
|
||||||
module:depends("admin_socket");
|
module:depends("admin_socket");
|
||||||
|
|
||||||
local hostmanager = require "core.hostmanager";
|
local hostmanager = require "prosody.core.hostmanager";
|
||||||
local modulemanager = require "core.modulemanager";
|
local modulemanager = require "prosody.core.modulemanager";
|
||||||
local s2smanager = require "core.s2smanager";
|
local s2smanager = require "prosody.core.s2smanager";
|
||||||
local portmanager = require "core.portmanager";
|
local portmanager = require "prosody.core.portmanager";
|
||||||
local helpers = require "util.helpers";
|
local helpers = require "prosody.util.helpers";
|
||||||
local server = require "net.server";
|
local server = require "prosody.net.server";
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
|
|
||||||
local _G = _G;
|
local _G = _G;
|
||||||
|
|
||||||
local prosody = _G.prosody;
|
local prosody = _G.prosody;
|
||||||
|
|
||||||
local unpack = table.unpack;
|
local unpack = table.unpack;
|
||||||
local iterators = require "util.iterators";
|
local iterators = require "prosody.util.iterators";
|
||||||
local keys, values = iterators.keys, iterators.values;
|
local keys, values = iterators.keys, iterators.values;
|
||||||
local jid_bare, jid_split, jid_join, jid_resource = import("util.jid", "bare", "prepped_split", "join", "resource");
|
local jid_bare, jid_split, jid_join, jid_resource = import("prosody.util.jid", "bare", "prepped_split", "join", "resource");
|
||||||
local set, array = require "util.set", require "util.array";
|
local set, array = require "prosody.util.set", require "prosody.util.array";
|
||||||
local cert_verify_identity = require "util.x509".verify_identity;
|
local cert_verify_identity = require "prosody.util.x509".verify_identity;
|
||||||
local envload = require "util.envload".envload;
|
local envload = require "prosody.util.envload".envload;
|
||||||
local envloadfile = require "util.envload".envloadfile;
|
local envloadfile = require "prosody.util.envload".envloadfile;
|
||||||
local has_pposix, pposix = pcall(require, "util.pposix");
|
local has_pposix, pposix = pcall(require, "prosody.util.pposix");
|
||||||
local async = require "util.async";
|
local async = require "prosody.util.async";
|
||||||
local serialization = require "util.serialization";
|
local serialization = require "prosody.util.serialization";
|
||||||
local serialize_config = serialization.new ({ fatal = false, unquoted = true});
|
local serialize_config = serialization.new ({ fatal = false, unquoted = true});
|
||||||
local time = require "util.time";
|
local time = require "prosody.util.time";
|
||||||
local promise = require "util.promise";
|
local promise = require "prosody.util.promise";
|
||||||
local logger = require "util.logger";
|
local logger = require "prosody.util.logger";
|
||||||
|
|
||||||
local t_insert = table.insert;
|
local t_insert = table.insert;
|
||||||
local t_concat = table.concat;
|
local t_concat = table.concat;
|
||||||
|
|
||||||
local format_number = require "util.human.units".format;
|
local format_number = require "prosody.util.human.units".format;
|
||||||
local format_table = require "util.human.io".table;
|
local format_table = require "prosody.util.human.io".table;
|
||||||
|
|
||||||
local function capitalize(s)
|
local function capitalize(s)
|
||||||
if not s then return end
|
if not s then return end
|
||||||
|
@ -696,7 +696,7 @@ end
|
||||||
|
|
||||||
def_env.config = {};
|
def_env.config = {};
|
||||||
function def_env.config:load(filename, format)
|
function def_env.config:load(filename, format)
|
||||||
local config_load = require "core.configmanager".load;
|
local config_load = require "prosody.core.configmanager".load;
|
||||||
local ok, err = config_load(filename, format);
|
local ok, err = config_load(filename, format);
|
||||||
if not ok then
|
if not ok then
|
||||||
return false, err or "Unknown error loading config";
|
return false, err or "Unknown error loading config";
|
||||||
|
@ -708,7 +708,7 @@ function def_env.config:get(host, key)
|
||||||
if key == nil then
|
if key == nil then
|
||||||
host, key = "*", host;
|
host, key = "*", host;
|
||||||
end
|
end
|
||||||
local config_get = require "core.configmanager".get
|
local config_get = require "prosody.core.configmanager".get
|
||||||
return true, serialize_config(config_get(host, key));
|
return true, serialize_config(config_get(host, key));
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1506,7 +1506,7 @@ function def_env.muc:affiliations(room_jid, filter)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local um = require"core.usermanager";
|
local um = require"prosody.core.usermanager";
|
||||||
|
|
||||||
def_env.user = {};
|
def_env.user = {};
|
||||||
function def_env.user:create(jid, password, role)
|
function def_env.user:create(jid, password, role)
|
||||||
|
@ -1677,7 +1677,7 @@ end
|
||||||
|
|
||||||
def_env.xmpp = {};
|
def_env.xmpp = {};
|
||||||
|
|
||||||
local new_id = require "util.id".medium;
|
local new_id = require "prosody.util.id".medium;
|
||||||
function def_env.xmpp:ping(localhost, remotehost, timeout)
|
function def_env.xmpp:ping(localhost, remotehost, timeout)
|
||||||
localhost = select(2, jid_split(localhost));
|
localhost = select(2, jid_split(localhost));
|
||||||
remotehost = select(2, jid_split(remotehost));
|
remotehost = select(2, jid_split(remotehost));
|
||||||
|
@ -1729,7 +1729,7 @@ function def_env.xmpp:ping(localhost, remotehost, timeout)
|
||||||
end
|
end
|
||||||
|
|
||||||
def_env.dns = {};
|
def_env.dns = {};
|
||||||
local adns = require"net.adns";
|
local adns = require"prosody.net.adns";
|
||||||
|
|
||||||
local function get_resolver(session)
|
local function get_resolver(session)
|
||||||
local resolver = session.dns_resolver;
|
local resolver = session.dns_resolver;
|
||||||
|
@ -1872,7 +1872,7 @@ function def_env.debug:events(host, event)
|
||||||
local events_obj;
|
local events_obj;
|
||||||
if host and host ~= "*" then
|
if host and host ~= "*" then
|
||||||
if host == "http" then
|
if host == "http" then
|
||||||
events_obj = require "net.http.server"._events;
|
events_obj = require "prosody.net.http.server"._events;
|
||||||
elseif not prosody.hosts[host] then
|
elseif not prosody.hosts[host] then
|
||||||
return false, "Unknown host: "..host;
|
return false, "Unknown host: "..host;
|
||||||
else
|
else
|
||||||
|
@ -1886,7 +1886,7 @@ end
|
||||||
|
|
||||||
function def_env.debug:timers()
|
function def_env.debug:timers()
|
||||||
local print = self.session.print;
|
local print = self.session.print;
|
||||||
local add_task = require"util.timer".add_task;
|
local add_task = require"prosody.util.timer".add_task;
|
||||||
local h, params = add_task.h, add_task.params;
|
local h, params = add_task.h, add_task.params;
|
||||||
local function normalize_time(t)
|
local function normalize_time(t)
|
||||||
return t;
|
return t;
|
||||||
|
@ -2183,7 +2183,7 @@ local function new_stats_context(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
function def_env.stats:show(name_filter)
|
function def_env.stats:show(name_filter)
|
||||||
local statsman = require "core.statsmanager"
|
local statsman = require "prosody.core.statsmanager"
|
||||||
local collect = statsman.collect
|
local collect = statsman.collect
|
||||||
if collect then
|
if collect then
|
||||||
-- force collection if in manual mode
|
-- force collection if in manual mode
|
||||||
|
|
|
@ -16,10 +16,10 @@ if not have_unix or type(unix) ~= "table" then
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
local server = require "net.server";
|
local server = require "prosody.net.server";
|
||||||
|
|
||||||
local adminstream = require "util.adminstream";
|
local adminstream = require "prosody.util.adminstream";
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
|
|
||||||
local socket_path = module:get_option_path("admin_socket", "prosody.sock", "data");
|
local socket_path = module:get_option_path("admin_socket", "prosody.sock", "data");
|
||||||
|
|
||||||
|
|
|
@ -12,8 +12,8 @@ module:depends("admin_shell");
|
||||||
|
|
||||||
local console_listener = { default_port = 5582; default_mode = "*a"; interface = "127.0.0.1" };
|
local console_listener = { default_port = 5582; default_mode = "*a"; interface = "127.0.0.1" };
|
||||||
|
|
||||||
local async = require "util.async";
|
local async = require "prosody.util.async";
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
|
|
||||||
local def_env = module:shared("admin_shell/env");
|
local def_env = module:shared("admin_shell/env");
|
||||||
local default_env_mt = { __index = def_env };
|
local default_env_mt = { __index = def_env };
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
-- COPYING file in the source package for more information.
|
-- COPYING file in the source package for more information.
|
||||||
--
|
--
|
||||||
|
|
||||||
local st, jid = require "util.stanza", require "util.jid";
|
local st, jid = require "prosody.util.stanza", require "prosody.util.jid";
|
||||||
|
|
||||||
local hosts = prosody.hosts;
|
local hosts = prosody.hosts;
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ end
|
||||||
module:hook("message/host", handle_announcement);
|
module:hook("message/host", handle_announcement);
|
||||||
|
|
||||||
-- Ad-hoc command (XEP-0133)
|
-- Ad-hoc command (XEP-0133)
|
||||||
local dataforms_new = require "util.dataforms".new;
|
local dataforms_new = require "prosody.util.dataforms".new;
|
||||||
local announce_layout = dataforms_new{
|
local announce_layout = dataforms_new{
|
||||||
title = "Making an Announcement";
|
title = "Making an Announcement";
|
||||||
instructions = "Fill out this form to make an announcement to all\nactive users of this service.";
|
instructions = "Fill out this form to make an announcement to all\nactive users of this service.";
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
--
|
--
|
||||||
-- luacheck: ignore 212
|
-- luacheck: ignore 212
|
||||||
|
|
||||||
local new_sasl = require "util.sasl".new;
|
local new_sasl = require "prosody.util.sasl".new;
|
||||||
local datamanager = require "util.datamanager";
|
local datamanager = require "prosody.util.datamanager";
|
||||||
local hosts = prosody.hosts;
|
local hosts = prosody.hosts;
|
||||||
|
|
||||||
local allow_storage = module:get_option_boolean("allow_anonymous_storage", false);
|
local allow_storage = module:get_option_boolean("allow_anonymous_storage", false);
|
||||||
|
|
|
@ -7,9 +7,9 @@
|
||||||
--
|
--
|
||||||
-- luacheck: ignore 212
|
-- luacheck: ignore 212
|
||||||
|
|
||||||
local datamanager = require "util.datamanager";
|
local datamanager = require "prosody.util.datamanager";
|
||||||
local new_sasl = require "util.sasl".new;
|
local new_sasl = require "prosody.util.sasl".new;
|
||||||
local saslprep = require "util.encodings".stringprep.saslprep;
|
local saslprep = require "prosody.util.encodings".stringprep.saslprep;
|
||||||
|
|
||||||
local host = module.host;
|
local host = module.host;
|
||||||
local provider = { name = "insecure" };
|
local provider = { name = "insecure" };
|
||||||
|
|
|
@ -9,13 +9,13 @@
|
||||||
|
|
||||||
local max = math.max;
|
local max = math.max;
|
||||||
|
|
||||||
local scram_hashers = require "util.sasl.scram".hashers;
|
local scram_hashers = require "prosody.util.sasl.scram".hashers;
|
||||||
local generate_uuid = require "util.uuid".generate;
|
local generate_uuid = require "prosody.util.uuid".generate;
|
||||||
local new_sasl = require "util.sasl".new;
|
local new_sasl = require "prosody.util.sasl".new;
|
||||||
local hex = require"util.hex";
|
local hex = require"prosody.util.hex";
|
||||||
local to_hex, from_hex = hex.encode, hex.decode;
|
local to_hex, from_hex = hex.encode, hex.decode;
|
||||||
local saslprep = require "util.encodings".stringprep.saslprep;
|
local saslprep = require "prosody.util.encodings".stringprep.saslprep;
|
||||||
local secure_equals = require "util.hashes".equals;
|
local secure_equals = require "prosody.util.hashes".equals;
|
||||||
|
|
||||||
local log = module._log;
|
local log = module._log;
|
||||||
local host = module.host;
|
local host = module.host;
|
||||||
|
|
|
@ -6,10 +6,10 @@
|
||||||
-- COPYING file in the source package for more information.
|
-- COPYING file in the source package for more information.
|
||||||
--
|
--
|
||||||
|
|
||||||
local usermanager = require "core.usermanager";
|
local usermanager = require "prosody.core.usermanager";
|
||||||
local new_sasl = require "util.sasl".new;
|
local new_sasl = require "prosody.util.sasl".new;
|
||||||
local saslprep = require "util.encodings".stringprep.saslprep;
|
local saslprep = require "prosody.util.encodings".stringprep.saslprep;
|
||||||
local secure_equals = require "util.hashes".equals;
|
local secure_equals = require "prosody.util.hashes".equals;
|
||||||
|
|
||||||
local log = module._log;
|
local log = module._log;
|
||||||
local host = module.host;
|
local host = module.host;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
-- mod_auth_ldap
|
-- mod_auth_ldap
|
||||||
|
|
||||||
local new_sasl = require "util.sasl".new;
|
local new_sasl = require "prosody.util.sasl".new;
|
||||||
local lualdap = require "lualdap";
|
local lualdap = require "lualdap";
|
||||||
|
|
||||||
local function ldap_filter_escape(s)
|
local function ldap_filter_escape(s)
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
local array = require "util.array";
|
local array = require "prosody.util.array";
|
||||||
local it = require "util.iterators";
|
local it = require "prosody.util.iterators";
|
||||||
local set = require "util.set";
|
local set = require "prosody.util.set";
|
||||||
local jid_split, jid_bare, jid_host = import("util.jid", "split", "bare", "host");
|
local jid_split, jid_bare, jid_host = import("prosody.util.jid", "split", "bare", "host");
|
||||||
local normalize = require "util.jid".prep;
|
local normalize = require "prosody.util.jid".prep;
|
||||||
local roles = require "util.roles";
|
local roles = require "prosody.util.roles";
|
||||||
|
|
||||||
local config_global_admin_jids = module:context("*"):get_option_set("admins", {}) / normalize;
|
local config_global_admin_jids = module:context("*"):get_option_set("admins", {}) / normalize;
|
||||||
local config_admin_jids = module:get_option_inherited_set("admins", {}) / normalize;
|
local config_admin_jids = module:get_option_inherited_set("admins", {}) / normalize;
|
||||||
|
@ -321,7 +321,7 @@ function module.command(arg)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Initialize storage layer
|
-- Initialize storage layer
|
||||||
require "core.storagemanager".initialize_host(migrate_host);
|
require "prosody.core.storagemanager".initialize_host(migrate_host);
|
||||||
|
|
||||||
print("II: Migrating roles...");
|
print("II: Migrating roles...");
|
||||||
local migrated, failed, skipped = do_migration(migrate_host);
|
local migrated, failed, skipped = do_migration(migrate_host);
|
||||||
|
|
|
@ -9,16 +9,16 @@
|
||||||
-- This module implements XEP-0191: Blocking Command
|
-- This module implements XEP-0191: Blocking Command
|
||||||
--
|
--
|
||||||
|
|
||||||
local user_exists = require"core.usermanager".user_exists;
|
local user_exists = require"prosody.core.usermanager".user_exists;
|
||||||
local rostermanager = require"core.rostermanager";
|
local rostermanager = require"prosody.core.rostermanager";
|
||||||
local is_contact_subscribed = rostermanager.is_contact_subscribed;
|
local is_contact_subscribed = rostermanager.is_contact_subscribed;
|
||||||
local is_contact_pending_in = rostermanager.is_contact_pending_in;
|
local is_contact_pending_in = rostermanager.is_contact_pending_in;
|
||||||
local load_roster = rostermanager.load_roster;
|
local load_roster = rostermanager.load_roster;
|
||||||
local save_roster = rostermanager.save_roster;
|
local save_roster = rostermanager.save_roster;
|
||||||
local st = require"util.stanza";
|
local st = require"prosody.util.stanza";
|
||||||
local st_error_reply = st.error_reply;
|
local st_error_reply = st.error_reply;
|
||||||
local jid_prep = require"util.jid".prep;
|
local jid_prep = require"prosody.util.jid".prep;
|
||||||
local jid_split = require"util.jid".split;
|
local jid_split = require"prosody.util.jid".split;
|
||||||
|
|
||||||
local storage = module:open_store();
|
local storage = module:open_store();
|
||||||
local sessions = prosody.hosts[module.host].sessions;
|
local sessions = prosody.hosts[module.host].sessions;
|
||||||
|
@ -36,7 +36,7 @@ local cache = setmetatable({}, { __mode = "v" });
|
||||||
-- want to use too much memory either, so this can be tuned by advanced
|
-- want to use too much memory either, so this can be tuned by advanced
|
||||||
-- users. TODO use science to figure out a better default, 64 is just a guess.
|
-- users. TODO use science to figure out a better default, 64 is just a guess.
|
||||||
local cache_size = module:get_option_number("blocklist_cache_size", 64);
|
local cache_size = module:get_option_number("blocklist_cache_size", 64);
|
||||||
local cache2 = require"util.cache".new(cache_size);
|
local cache2 = require"prosody.util.cache".new(cache_size);
|
||||||
|
|
||||||
local null_blocklist = {};
|
local null_blocklist = {};
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
local mm = require "core.modulemanager";
|
local mm = require "prosody.core.modulemanager";
|
||||||
if mm.get_modules_for_host(module.host):contains("bookmarks2") then
|
if mm.get_modules_for_host(module.host):contains("bookmarks2") then
|
||||||
error("mod_bookmarks and mod_bookmarks2 are conflicting, please disable one of them.", 0);
|
error("mod_bookmarks and mod_bookmarks2 are conflicting, please disable one of them.", 0);
|
||||||
end
|
end
|
||||||
|
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local jid_split = require "util.jid".split;
|
local jid_split = require "prosody.util.jid".split;
|
||||||
|
|
||||||
local mod_pep = module:depends "pep";
|
local mod_pep = module:depends "pep";
|
||||||
local private_storage = module:open_store("private", "map");
|
local private_storage = module:open_store("private", "map");
|
||||||
|
|
|
@ -8,21 +8,21 @@
|
||||||
|
|
||||||
module:set_global();
|
module:set_global();
|
||||||
|
|
||||||
local new_xmpp_stream = require "util.xmppstream".new;
|
local new_xmpp_stream = require "prosody.util.xmppstream".new;
|
||||||
local sm = require "core.sessionmanager";
|
local sm = require "prosody.core.sessionmanager";
|
||||||
local sm_destroy_session = sm.destroy_session;
|
local sm_destroy_session = sm.destroy_session;
|
||||||
local new_uuid = require "util.uuid".generate;
|
local new_uuid = require "prosody.util.uuid".generate;
|
||||||
local core_process_stanza = prosody.core_process_stanza;
|
local core_process_stanza = prosody.core_process_stanza;
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local logger = require "util.logger";
|
local logger = require "prosody.util.logger";
|
||||||
local log = module._log;
|
local log = module._log;
|
||||||
local initialize_filters = require "util.filters".initialize;
|
local initialize_filters = require "prosody.util.filters".initialize;
|
||||||
local math_min = math.min;
|
local math_min = math.min;
|
||||||
local tostring, type = tostring, type;
|
local tostring, type = tostring, type;
|
||||||
local traceback = debug.traceback;
|
local traceback = debug.traceback;
|
||||||
local runner = require"util.async".runner;
|
local runner = require"prosody.util.async".runner;
|
||||||
local nameprep = require "util.encodings".stringprep.nameprep;
|
local nameprep = require "prosody.util.encodings".stringprep.nameprep;
|
||||||
local cache = require "util.cache";
|
local cache = require "prosody.util.cache";
|
||||||
|
|
||||||
local xmlns_streams = "http://etherx.jabber.org/streams";
|
local xmlns_streams = "http://etherx.jabber.org/streams";
|
||||||
local xmlns_xmpp_streams = "urn:ietf:params:xml:ns:xmpp-streams";
|
local xmlns_xmpp_streams = "urn:ietf:params:xml:ns:xmpp-streams";
|
||||||
|
@ -559,6 +559,6 @@ function module.add_host(module)
|
||||||
});
|
});
|
||||||
end
|
end
|
||||||
|
|
||||||
if require"core.modulemanager".get_modules_for_host("*"):contains(module.name) then
|
if require"prosody.core.modulemanager".get_modules_for_host("*"):contains(module.name) then
|
||||||
module:add_host();
|
module:add_host();
|
||||||
end
|
end
|
||||||
|
|
|
@ -8,15 +8,15 @@
|
||||||
|
|
||||||
module:set_global();
|
module:set_global();
|
||||||
|
|
||||||
local add_task = require "util.timer".add_task;
|
local add_task = require "prosody.util.timer".add_task;
|
||||||
local new_xmpp_stream = require "util.xmppstream".new;
|
local new_xmpp_stream = require "prosody.util.xmppstream".new;
|
||||||
local nameprep = require "util.encodings".stringprep.nameprep;
|
local nameprep = require "prosody.util.encodings".stringprep.nameprep;
|
||||||
local sessionmanager = require "core.sessionmanager";
|
local sessionmanager = require "prosody.core.sessionmanager";
|
||||||
local statsmanager = require "core.statsmanager";
|
local statsmanager = require "prosody.core.statsmanager";
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local sm_new_session, sm_destroy_session = sessionmanager.new_session, sessionmanager.destroy_session;
|
local sm_new_session, sm_destroy_session = sessionmanager.new_session, sessionmanager.destroy_session;
|
||||||
local uuid_generate = require "util.uuid".generate;
|
local uuid_generate = require "prosody.util.uuid".generate;
|
||||||
local async = require "util.async";
|
local async = require "prosody.util.async";
|
||||||
local runner = async.runner;
|
local runner = async.runner;
|
||||||
|
|
||||||
local tostring, type = tostring, type;
|
local tostring, type = tostring, type;
|
||||||
|
@ -438,7 +438,7 @@ module:hook("c2s-read-timeout", keepalive, -1);
|
||||||
|
|
||||||
module:hook("server-stopping", function(event) -- luacheck: ignore 212/event
|
module:hook("server-stopping", function(event) -- luacheck: ignore 212/event
|
||||||
-- Close ports
|
-- Close ports
|
||||||
local pm = require "core.portmanager";
|
local pm = require "prosody.core.portmanager";
|
||||||
for _, netservice in pairs(module.items["net-provider"]) do
|
for _, netservice in pairs(module.items["net-provider"]) do
|
||||||
pm.unregister_service(netservice.name, netservice);
|
pm.unregister_service(netservice.name, netservice);
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
--
|
--
|
||||||
-- This file is MIT/X11 licensed.
|
-- This file is MIT/X11 licensed.
|
||||||
|
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local jid_bare = require "util.jid".bare;
|
local jid_bare = require "prosody.util.jid".bare;
|
||||||
local jid_resource = require "util.jid".resource;
|
local jid_resource = require "prosody.util.jid".resource;
|
||||||
local xmlns_carbons = "urn:xmpp:carbons:2";
|
local xmlns_carbons = "urn:xmpp:carbons:2";
|
||||||
local xmlns_forward = "urn:xmpp:forward:0";
|
local xmlns_forward = "urn:xmpp:forward:0";
|
||||||
local full_sessions, bare_sessions = prosody.full_sessions, prosody.bare_sessions;
|
local full_sessions, bare_sessions = prosody.full_sessions, prosody.bare_sessions;
|
||||||
|
|
|
@ -10,16 +10,16 @@ module:set_global();
|
||||||
|
|
||||||
local t_concat = table.concat;
|
local t_concat = table.concat;
|
||||||
local tostring, type = tostring, type;
|
local tostring, type = tostring, type;
|
||||||
local xpcall = require "util.xpcall".xpcall;
|
local xpcall = require "prosody.util.xpcall".xpcall;
|
||||||
local traceback = debug.traceback;
|
local traceback = debug.traceback;
|
||||||
|
|
||||||
local logger = require "util.logger";
|
local logger = require "prosody.util.logger";
|
||||||
local sha1 = require "util.hashes".sha1;
|
local sha1 = require "prosody.util.hashes".sha1;
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
|
|
||||||
local jid_host = require "util.jid".host;
|
local jid_host = require "prosody.util.jid".host;
|
||||||
local new_xmpp_stream = require "util.xmppstream".new;
|
local new_xmpp_stream = require "prosody.util.xmppstream".new;
|
||||||
local uuid_gen = require "util.uuid".generate;
|
local uuid_gen = require "prosody.util.uuid".generate;
|
||||||
|
|
||||||
local core_process_stanza = prosody.core_process_stanza;
|
local core_process_stanza = prosody.core_process_stanza;
|
||||||
local hosts = prosody.hosts;
|
local hosts = prosody.hosts;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
module:set_global();
|
module:set_global();
|
||||||
|
|
||||||
local async = require("util.async");
|
local async = require("prosody.util.async");
|
||||||
local datetime = require("util.datetime");
|
local datetime = require("prosody.util.datetime");
|
||||||
|
|
||||||
local periods = { hourly = 3600; daily = 86400; weekly = 7 * 86400 }
|
local periods = { hourly = 3600; daily = 86400; weekly = 7 * 86400 }
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local xmlns_csi = "urn:xmpp:csi:0";
|
local xmlns_csi = "urn:xmpp:csi:0";
|
||||||
local csi_feature = st.stanza("csi", { xmlns = xmlns_csi });
|
local csi_feature = st.stanza("csi", { xmlns = xmlns_csi });
|
||||||
|
|
||||||
|
|
|
@ -6,11 +6,11 @@
|
||||||
|
|
||||||
module:depends"csi"
|
module:depends"csi"
|
||||||
|
|
||||||
local jid = require "util.jid";
|
local jid = require "prosody.util.jid";
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local dt = require "util.datetime";
|
local dt = require "prosody.util.datetime";
|
||||||
local filters = require "util.filters";
|
local filters = require "prosody.util.filters";
|
||||||
local timer = require "util.timer";
|
local timer = require "prosody.util.timer";
|
||||||
|
|
||||||
local queue_size = module:get_option_number("csi_queue_size", 256);
|
local queue_size = module:get_option_number("csi_queue_size", 256);
|
||||||
local resume_delay = module:get_option_number("csi_resume_inactive_delay", 5);
|
local resume_delay = module:get_option_number("csi_resume_inactive_delay", 5);
|
||||||
|
@ -255,7 +255,7 @@ function module.command(arg)
|
||||||
return 1;
|
return 1;
|
||||||
end
|
end
|
||||||
-- luacheck: ignore 212/self
|
-- luacheck: ignore 212/self
|
||||||
local xmppstream = require "util.xmppstream";
|
local xmppstream = require "prosody.util.xmppstream";
|
||||||
local input_session = { notopen = true }
|
local input_session = { notopen = true }
|
||||||
local stream_callbacks = { stream_ns = "jabber:client", default_ns = "jabber:client" };
|
local stream_callbacks = { stream_ns = "jabber:client", default_ns = "jabber:client" };
|
||||||
function stream_callbacks:handlestanza(stanza)
|
function stream_callbacks:handlestanza(stanza)
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
|
|
||||||
module:set_global();
|
module:set_global();
|
||||||
|
|
||||||
local hostmanager = require "core.hostmanager";
|
local hostmanager = require "prosody.core.hostmanager";
|
||||||
|
|
||||||
local timer = require "util.timer";
|
local timer = require "prosody.util.timer";
|
||||||
|
|
||||||
local function do_reset()
|
local function do_reset()
|
||||||
module:log("info", "Performing reset...");
|
module:log("info", "Performing reset...");
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
local filters = require "util.filters";
|
local filters = require "prosody.util.filters";
|
||||||
local jid = require "util.jid";
|
local jid = require "prosody.util.jid";
|
||||||
local set = require "util.set";
|
local set = require "prosody.util.set";
|
||||||
|
|
||||||
local client_watchers = {};
|
local client_watchers = {};
|
||||||
|
|
||||||
|
|
|
@ -10,12 +10,12 @@ local hosts = _G.hosts;
|
||||||
|
|
||||||
local log = module._log;
|
local log = module._log;
|
||||||
|
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local sha256_hash = require "util.hashes".sha256;
|
local sha256_hash = require "prosody.util.hashes".sha256;
|
||||||
local sha256_hmac = require "util.hashes".hmac_sha256;
|
local sha256_hmac = require "prosody.util.hashes".hmac_sha256;
|
||||||
local secure_equals = require "util.hashes".equals;
|
local secure_equals = require "prosody.util.hashes".equals;
|
||||||
local nameprep = require "util.encodings".stringprep.nameprep;
|
local nameprep = require "prosody.util.encodings".stringprep.nameprep;
|
||||||
local uuid_gen = require"util.uuid".generate;
|
local uuid_gen = require"prosody.util.uuid".generate;
|
||||||
|
|
||||||
local xmlns_stream = "http://etherx.jabber.org/streams";
|
local xmlns_stream = "http://etherx.jabber.org/streams";
|
||||||
|
|
||||||
|
|
|
@ -6,12 +6,12 @@
|
||||||
-- COPYING file in the source package for more information.
|
-- COPYING file in the source package for more information.
|
||||||
--
|
--
|
||||||
|
|
||||||
local get_children = require "core.hostmanager".get_children;
|
local get_children = require "prosody.core.hostmanager".get_children;
|
||||||
local is_contact_subscribed = require "core.rostermanager".is_contact_subscribed;
|
local is_contact_subscribed = require "prosody.core.rostermanager".is_contact_subscribed;
|
||||||
local jid_split = require "util.jid".split;
|
local jid_split = require "prosody.util.jid".split;
|
||||||
local jid_bare = require "util.jid".bare;
|
local jid_bare = require "prosody.util.jid".bare;
|
||||||
local st = require "util.stanza"
|
local st = require "prosody.util.stanza"
|
||||||
local calculate_hash = require "util.caps".calculate_hash;
|
local calculate_hash = require "prosody.util.caps".calculate_hash;
|
||||||
|
|
||||||
local expose_admins = module:get_option_boolean("disco_expose_admins", false);
|
local expose_admins = module:get_option_boolean("disco_expose_admins", false);
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
|
|
||||||
local dt = require "util.datetime";
|
local dt = require "prosody.util.datetime";
|
||||||
local base64 = require "util.encodings".base64;
|
local base64 = require "prosody.util.encodings".base64;
|
||||||
local hashes = require "util.hashes";
|
local hashes = require "prosody.util.hashes";
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local jid = require "util.jid";
|
local jid = require "prosody.util.jid";
|
||||||
local array = require "util.array";
|
local array = require "prosody.util.array";
|
||||||
local set = require "util.set";
|
local set = require "prosody.util.set";
|
||||||
|
|
||||||
local default_host = module:get_option_string("external_service_host", module.host);
|
local default_host = module:get_option_string("external_service_host", module.host);
|
||||||
local default_port = module:get_option_number("external_service_port");
|
local default_port = module:get_option_number("external_service_port");
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
local groups;
|
local groups;
|
||||||
local members;
|
local members;
|
||||||
|
|
||||||
local datamanager = require "util.datamanager";
|
local datamanager = require "prosody.util.datamanager";
|
||||||
local jid_prep = require "util.jid".prep;
|
local jid_prep = require "prosody.util.jid".prep;
|
||||||
|
|
||||||
local module_host = module:get_host();
|
local module_host = module:get_host();
|
||||||
|
|
||||||
|
|
|
@ -11,19 +11,19 @@ pcall(function ()
|
||||||
module:depends("http_errors");
|
module:depends("http_errors");
|
||||||
end);
|
end);
|
||||||
|
|
||||||
local portmanager = require "core.portmanager";
|
local portmanager = require "prosody.core.portmanager";
|
||||||
local moduleapi = require "core.moduleapi";
|
local moduleapi = require "prosody.core.moduleapi";
|
||||||
local url_parse = require "socket.url".parse;
|
local url_parse = require "socket.url".parse;
|
||||||
local url_build = require "socket.url".build;
|
local url_build = require "socket.url".build;
|
||||||
local normalize_path = require "util.http".normalize_path;
|
local normalize_path = require "prosody.util.http".normalize_path;
|
||||||
local set = require "util.set";
|
local set = require "prosody.util.set";
|
||||||
|
|
||||||
local ip_util = require "util.ip";
|
local ip_util = require "prosody.util.ip";
|
||||||
local new_ip = ip_util.new_ip;
|
local new_ip = ip_util.new_ip;
|
||||||
local match_ip = ip_util.match;
|
local match_ip = ip_util.match;
|
||||||
local parse_cidr = ip_util.parse_cidr;
|
local parse_cidr = ip_util.parse_cidr;
|
||||||
|
|
||||||
local server = require "net.http.server";
|
local server = require "prosody.net.http.server";
|
||||||
|
|
||||||
server.set_default_host(module:get_option_string("http_default_host"));
|
server.set_default_host(module:get_option_string("http_default_host"));
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
module:set_global();
|
module:set_global();
|
||||||
|
|
||||||
local server = require "net.http.server";
|
local server = require "prosody.net.http.server";
|
||||||
local codes = require "net.http.codes";
|
local codes = require "prosody.net.http.codes";
|
||||||
local xml_escape = require "util.stanza".xml_escape;
|
local xml_escape = require "prosody.util.stanza".xml_escape;
|
||||||
local render = require "util.interpolation".new("%b{}", xml_escape);
|
local render = require "prosody.util.interpolation".new("%b{}", xml_escape);
|
||||||
|
|
||||||
local show_private = module:get_option_boolean("http_errors_detailed", false);
|
local show_private = module:get_option_boolean("http_errors_detailed", false);
|
||||||
local always_serve = module:get_option_boolean("http_errors_always_show", true);
|
local always_serve = module:get_option_boolean("http_errors_always_show", true);
|
||||||
|
|
|
@ -8,16 +8,16 @@
|
||||||
-- Again, from the top!
|
-- Again, from the top!
|
||||||
|
|
||||||
local t_insert = table.insert;
|
local t_insert = table.insert;
|
||||||
local jid = require "util.jid";
|
local jid = require "prosody.util.jid";
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local url = require "socket.url";
|
local url = require "socket.url";
|
||||||
local dm = require "core.storagemanager".olddm;
|
local dm = require "prosody.core.storagemanager".olddm;
|
||||||
local errors = require "util.error";
|
local errors = require "prosody.util.error";
|
||||||
local dataform = require "util.dataforms".new;
|
local dataform = require "prosody.util.dataforms".new;
|
||||||
local urlencode = require "util.http".urlencode;
|
local urlencode = require "prosody.util.http".urlencode;
|
||||||
local dt = require "util.datetime";
|
local dt = require "prosody.util.datetime";
|
||||||
local hi = require "util.human.units";
|
local hi = require "prosody.util.human.units";
|
||||||
local cache = require "util.cache";
|
local cache = require "prosody.util.cache";
|
||||||
local lfs = require "lfs";
|
local lfs = require "lfs";
|
||||||
|
|
||||||
local unknown = math.abs(0/0);
|
local unknown = math.abs(0/0);
|
||||||
|
@ -34,7 +34,7 @@ local uploads = module:open_store("uploads", "archive");
|
||||||
local persist_stats = module:open_store("upload_stats", "map");
|
local persist_stats = module:open_store("upload_stats", "map");
|
||||||
-- id, <request>, time, owner
|
-- id, <request>, time, owner
|
||||||
|
|
||||||
local secret = module:get_option_string(module.name.."_secret", require"util.id".long());
|
local secret = module:get_option_string(module.name.."_secret", require"prosody.util.id".long());
|
||||||
local external_base_url = module:get_option_string(module.name .. "_base_url");
|
local external_base_url = module:get_option_string(module.name .. "_base_url");
|
||||||
local file_size_limit = module:get_option_number(module.name .. "_size_limit", 10 * 1024 * 1024); -- 10 MB
|
local file_size_limit = module:get_option_number(module.name .. "_size_limit", 10 * 1024 * 1024); -- 10 MB
|
||||||
local file_types = module:get_option_set(module.name .. "_allowed_file_types", {});
|
local file_types = module:get_option_set(module.name .. "_allowed_file_types", {});
|
||||||
|
@ -43,7 +43,7 @@ local expiry = module:get_option_number(module.name .. "_expires_after", 7 * 864
|
||||||
local daily_quota = module:get_option_number(module.name .. "_daily_quota", file_size_limit*10); -- 100 MB / day
|
local daily_quota = module:get_option_number(module.name .. "_daily_quota", file_size_limit*10); -- 100 MB / day
|
||||||
local total_storage_limit = module:get_option_number(module.name.."_global_quota", unlimited);
|
local total_storage_limit = module:get_option_number(module.name.."_global_quota", unlimited);
|
||||||
|
|
||||||
local create_jwt, verify_jwt = require "util.jwt".init("HS256", secret);
|
local create_jwt, verify_jwt = require "prosody.util.jwt".init("HS256", secret);
|
||||||
|
|
||||||
local access = module:get_option_set(module.name .. "_access", {});
|
local access = module:get_option_set(module.name .. "_access", {});
|
||||||
|
|
||||||
|
@ -452,9 +452,9 @@ end
|
||||||
|
|
||||||
if expiry >= 0 and not external_base_url then
|
if expiry >= 0 and not external_base_url then
|
||||||
-- TODO HTTP DELETE to the external endpoint?
|
-- TODO HTTP DELETE to the external endpoint?
|
||||||
local array = require "util.array";
|
local array = require "prosody.util.array";
|
||||||
local async = require "util.async";
|
local async = require "prosody.util.async";
|
||||||
local ENOENT = require "util.pposix".ENOENT;
|
local ENOENT = require "prosody.util.pposix".ENOENT;
|
||||||
|
|
||||||
local function sleep(t)
|
local function sleep(t)
|
||||||
local wait, done = async.waiter();
|
local wait, done = async.waiter();
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
module:depends("http");
|
module:depends("http");
|
||||||
|
|
||||||
local open = io.open;
|
local open = io.open;
|
||||||
local fileserver = require"net.http.files";
|
local fileserver = require"prosody.net.http.files";
|
||||||
|
|
||||||
local base_path = module:get_option_path("http_files_dir", module:get_option_path("http_path"));
|
local base_path = module:get_option_path("http_files_dir", module:get_option_path("http_path"));
|
||||||
local cache_size = module:get_option_number("http_files_cache_size", 128);
|
local cache_size = module:get_option_number("http_files_cache_size", 128);
|
||||||
|
@ -74,12 +74,12 @@ function serve(opts)
|
||||||
if opts.index_files == nil then
|
if opts.index_files == nil then
|
||||||
opts.index_files = dir_indices;
|
opts.index_files = dir_indices;
|
||||||
end
|
end
|
||||||
module:log("warn", "%s should be updated to use 'net.http.files' instead of mod_http_files", get_calling_module());
|
module:log("warn", "%s should be updated to use 'prosody.net.http.files' instead of mod_http_files", get_calling_module());
|
||||||
return fileserver.serve(opts);
|
return fileserver.serve(opts);
|
||||||
end
|
end
|
||||||
|
|
||||||
function wrap_route(routes)
|
function wrap_route(routes)
|
||||||
module:log("debug", "%s should be updated to use 'net.http.files' instead of mod_http_files", get_calling_module());
|
module:log("debug", "%s should be updated to use 'prosody.net.http.files' instead of mod_http_files", get_calling_module());
|
||||||
for route,handler in pairs(routes) do
|
for route,handler in pairs(routes) do
|
||||||
if type(handler) ~= "function" then
|
if type(handler) ~= "function" then
|
||||||
routes[route] = fileserver.serve(handler);
|
routes[route] = fileserver.serve(handler);
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
|
|
||||||
module:set_global();
|
module:set_global();
|
||||||
|
|
||||||
local statsman = require "core.statsmanager";
|
local statsman = require "prosody.core.statsmanager";
|
||||||
local ip = require "util.ip";
|
local ip = require "prosody.util.ip";
|
||||||
|
|
||||||
local get_metric_registry = statsman.get_metric_registry;
|
local get_metric_registry = statsman.get_metric_registry;
|
||||||
local collect = statsman.collect;
|
local collect = statsman.collect;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
local id = require "util.id";
|
local id = require "prosody.util.id";
|
||||||
local it = require "util.iterators";
|
local it = require "prosody.util.iterators";
|
||||||
local url = require "socket.url";
|
local url = require "socket.url";
|
||||||
local jid_node = require "util.jid".node;
|
local jid_node = require "prosody.util.jid".node;
|
||||||
local jid_split = require "util.jid".split;
|
local jid_split = require "prosody.util.jid".split;
|
||||||
|
|
||||||
local default_ttl = module:get_option_number("invite_expiry", 86400 * 7);
|
local default_ttl = module:get_option_number("invite_expiry", 86400 * 7);
|
||||||
|
|
||||||
|
@ -205,7 +205,7 @@ do
|
||||||
-- Since the console is global this overwrites the command for
|
-- Since the console is global this overwrites the command for
|
||||||
-- each host it's loaded on, but this should be fine.
|
-- each host it's loaded on, but this should be fine.
|
||||||
|
|
||||||
local get_module = require "core.modulemanager".get_module;
|
local get_module = require "prosody.core.modulemanager".get_module;
|
||||||
|
|
||||||
local console_env = module:shared("/*/admin_shell/env");
|
local console_env = module:shared("/*/admin_shell/env");
|
||||||
|
|
||||||
|
@ -238,8 +238,8 @@ function module.command(arg)
|
||||||
end
|
end
|
||||||
table.remove(arg, 1); -- pop command
|
table.remove(arg, 1); -- pop command
|
||||||
|
|
||||||
local sm = require "core.storagemanager";
|
local sm = require "prosody.core.storagemanager";
|
||||||
local mm = require "core.modulemanager";
|
local mm = require "prosody.core.modulemanager";
|
||||||
|
|
||||||
local host = arg[1];
|
local host = arg[1];
|
||||||
assert(prosody.hosts[host], "Host "..tostring(host).." does not exist");
|
assert(prosody.hosts[host], "Host "..tostring(host).." does not exist");
|
||||||
|
@ -288,7 +288,7 @@ function module.command(arg)
|
||||||
print("--reset and the other options cannot be mixed.")
|
print("--reset and the other options cannot be mixed.")
|
||||||
return 2
|
return 2
|
||||||
elseif value == "--reset" then
|
elseif value == "--reset" then
|
||||||
local nodeprep = require "util.encodings".stringprep.nodeprep;
|
local nodeprep = require "prosody.util.encodings".stringprep.nodeprep;
|
||||||
local username = nodeprep(arg[1])
|
local username = nodeprep(arg[1])
|
||||||
table.remove(arg, 1);
|
table.remove(arg, 1);
|
||||||
if not username then
|
if not username then
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
-- XEP-0401: Easy User Onboarding
|
-- XEP-0401: Easy User Onboarding
|
||||||
local dataforms = require "util.dataforms";
|
local dataforms = require "prosody.util.dataforms";
|
||||||
local datetime = require "util.datetime";
|
local datetime = require "prosody.util.datetime";
|
||||||
local split_jid = require "util.jid".split;
|
local split_jid = require "prosody.util.jid".split;
|
||||||
|
|
||||||
local new_adhoc = module:require("adhoc").new;
|
local new_adhoc = module:require("adhoc").new;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local jid_split = require "util.jid".split;
|
local jid_split = require "prosody.util.jid".split;
|
||||||
local jid_bare = require "util.jid".bare;
|
local jid_bare = require "prosody.util.jid".bare;
|
||||||
local rostermanager = require "core.rostermanager";
|
local rostermanager = require "prosody.core.rostermanager";
|
||||||
|
|
||||||
local require_encryption = module:get_option_boolean("c2s_require_encryption",
|
local require_encryption = module:get_option_boolean("c2s_require_encryption",
|
||||||
module:get_option_boolean("require_encryption", true));
|
module:get_option_boolean("require_encryption", true));
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
--
|
--
|
||||||
|
|
||||||
|
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
|
|
||||||
local full_sessions = prosody.full_sessions;
|
local full_sessions = prosody.full_sessions;
|
||||||
|
|
||||||
|
|
|
@ -6,10 +6,10 @@
|
||||||
-- COPYING file in the source package for more information.
|
-- COPYING file in the source package for more information.
|
||||||
--
|
--
|
||||||
|
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local is_contact_subscribed = require "core.rostermanager".is_contact_subscribed;
|
local is_contact_subscribed = require "prosody.core.rostermanager".is_contact_subscribed;
|
||||||
local jid_bare = require "util.jid".bare;
|
local jid_bare = require "prosody.util.jid".bare;
|
||||||
local jid_split = require "util.jid".split;
|
local jid_split = require "prosody.util.jid".split;
|
||||||
|
|
||||||
module:add_feature("jabber:iq:last");
|
module:add_feature("jabber:iq:last");
|
||||||
|
|
||||||
|
|
|
@ -8,17 +8,17 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local t_concat = table.concat;
|
local t_concat = table.concat;
|
||||||
|
|
||||||
local secure_auth_only = module:get_option("c2s_require_encryption",
|
local secure_auth_only = module:get_option("c2s_require_encryption",
|
||||||
module:get_option("require_encryption", true))
|
module:get_option("require_encryption", true))
|
||||||
or not(module:get_option("allow_unencrypted_plain_auth"));
|
or not(module:get_option("allow_unencrypted_plain_auth"));
|
||||||
|
|
||||||
local sessionmanager = require "core.sessionmanager";
|
local sessionmanager = require "prosody.core.sessionmanager";
|
||||||
local usermanager = require "core.usermanager";
|
local usermanager = require "prosody.core.usermanager";
|
||||||
local nodeprep = require "util.encodings".stringprep.nodeprep;
|
local nodeprep = require "prosody.util.encodings".stringprep.nodeprep;
|
||||||
local resourceprep = require "util.encodings".stringprep.resourceprep;
|
local resourceprep = require "prosody.util.encodings".stringprep.resourceprep;
|
||||||
|
|
||||||
module:add_feature("jabber:iq:auth");
|
module:add_feature("jabber:iq:auth");
|
||||||
module:hook("stream-features", function(event)
|
module:hook("stream-features", function(event)
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
-- Because we deal with pre-authed sessions and streams we can't be host-specific
|
-- Because we deal with pre-authed sessions and streams we can't be host-specific
|
||||||
module:set_global();
|
module:set_global();
|
||||||
|
|
||||||
local filters = require "util.filters";
|
local filters = require "prosody.util.filters";
|
||||||
local throttle = require "util.throttle";
|
local throttle = require "prosody.util.throttle";
|
||||||
local timer = require "util.timer";
|
local timer = require "prosody.util.timer";
|
||||||
local ceil = math.ceil;
|
local ceil = math.ceil;
|
||||||
|
|
||||||
local limits_cfg = module:get_option("limits", {});
|
local limits_cfg = module:get_option("limits", {});
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
-- XEP-0313: Message Archive Management for Prosody
|
-- XEP-0313: Message Archive Management for Prosody
|
||||||
--
|
--
|
||||||
|
|
||||||
local st = require"util.stanza";
|
local st = require"prosody.util.stanza";
|
||||||
local jid_prep = require"util.jid".prep;
|
local jid_prep = require"prosody.util.jid".prep;
|
||||||
local xmlns_mam = "urn:xmpp:mam:2";
|
local xmlns_mam = "urn:xmpp:mam:2";
|
||||||
|
|
||||||
local default_attrs = {
|
local default_attrs = {
|
||||||
|
|
|
@ -15,28 +15,28 @@ local xmlns_delay = "urn:xmpp:delay";
|
||||||
local xmlns_forward = "urn:xmpp:forward:0";
|
local xmlns_forward = "urn:xmpp:forward:0";
|
||||||
local xmlns_st_id = "urn:xmpp:sid:0";
|
local xmlns_st_id = "urn:xmpp:sid:0";
|
||||||
|
|
||||||
local um = require "core.usermanager";
|
local um = require "prosody.core.usermanager";
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local rsm = require "util.rsm";
|
local rsm = require "prosody.util.rsm";
|
||||||
local get_prefs = module:require"mamprefs".get;
|
local get_prefs = module:require"mamprefs".get;
|
||||||
local set_prefs = module:require"mamprefs".set;
|
local set_prefs = module:require"mamprefs".set;
|
||||||
local prefs_to_stanza = module:require"mamprefsxml".tostanza;
|
local prefs_to_stanza = module:require"mamprefsxml".tostanza;
|
||||||
local prefs_from_stanza = module:require"mamprefsxml".fromstanza;
|
local prefs_from_stanza = module:require"mamprefsxml".fromstanza;
|
||||||
local jid_bare = require "util.jid".bare;
|
local jid_bare = require "prosody.util.jid".bare;
|
||||||
local jid_split = require "util.jid".split;
|
local jid_split = require "prosody.util.jid".split;
|
||||||
local jid_resource = require "util.jid".resource;
|
local jid_resource = require "prosody.util.jid".resource;
|
||||||
local jid_prepped_split = require "util.jid".prepped_split;
|
local jid_prepped_split = require "prosody.util.jid".prepped_split;
|
||||||
local dataform = require "util.dataforms".new;
|
local dataform = require "prosody.util.dataforms".new;
|
||||||
local get_form_type = require "util.dataforms".get_type;
|
local get_form_type = require "prosody.util.dataforms".get_type;
|
||||||
local host = module.host;
|
local host = module.host;
|
||||||
|
|
||||||
local rm_load_roster = require "core.rostermanager".load_roster;
|
local rm_load_roster = require "prosody.core.rostermanager".load_roster;
|
||||||
|
|
||||||
local is_stanza = st.is_stanza;
|
local is_stanza = st.is_stanza;
|
||||||
local tostring = tostring;
|
local tostring = tostring;
|
||||||
local time_now = require "util.time".now;
|
local time_now = require "prosody.util.time".now;
|
||||||
local m_min = math.min;
|
local m_min = math.min;
|
||||||
local timestamp, datestamp = import("util.datetime", "datetime", "date");
|
local timestamp, datestamp = import("prosody.util.datetime", "datetime", "date");
|
||||||
local default_max_items, max_max_items = 20, module:get_option_number("max_archive_query_results", 50);
|
local default_max_items, max_max_items = 20, module:get_option_number("max_archive_query_results", 50);
|
||||||
local strip_tags = module:get_option_set("dont_archive_namespaces", { "http://jabber.org/protocol/chatstates" });
|
local strip_tags = module:get_option_set("dont_archive_namespaces", { "http://jabber.org/protocol/chatstates" });
|
||||||
|
|
||||||
|
@ -532,7 +532,7 @@ if cleanup_after ~= "never" then
|
||||||
-- outside the cleanup range.
|
-- outside the cleanup range.
|
||||||
|
|
||||||
if not (archive.caps and archive.caps.wildcard_delete) then
|
if not (archive.caps and archive.caps.wildcard_delete) then
|
||||||
local last_date = require "util.cache".new(module:get_option_number("archive_cleanup_date_cache_size", 1000));
|
local last_date = require "prosody.util.cache".new(module:get_option_number("archive_cleanup_date_cache_size", 1000));
|
||||||
function schedule_cleanup(username, date)
|
function schedule_cleanup(username, date)
|
||||||
date = date or datestamp();
|
date = date or datestamp();
|
||||||
if last_date:get(username) == date then return end
|
if last_date:get(username) == date then return end
|
||||||
|
@ -545,7 +545,7 @@ if cleanup_after ~= "never" then
|
||||||
|
|
||||||
local cleanup_time = module:measure("cleanup", "times");
|
local cleanup_time = module:measure("cleanup", "times");
|
||||||
|
|
||||||
local async = require "util.async";
|
local async = require "prosody.util.async";
|
||||||
module:daily("Remove expired messages", function ()
|
module:daily("Remove expired messages", function ()
|
||||||
local cleanup_done = cleanup_time();
|
local cleanup_done = cleanup_time();
|
||||||
|
|
||||||
|
|
|
@ -10,10 +10,10 @@
|
||||||
local full_sessions = prosody.full_sessions;
|
local full_sessions = prosody.full_sessions;
|
||||||
local bare_sessions = prosody.bare_sessions;
|
local bare_sessions = prosody.bare_sessions;
|
||||||
|
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local jid_bare = require "util.jid".bare;
|
local jid_bare = require "prosody.util.jid".bare;
|
||||||
local jid_split = require "util.jid".split;
|
local jid_split = require "prosody.util.jid".split;
|
||||||
local user_exists = require "core.usermanager".user_exists;
|
local user_exists = require "prosody.core.usermanager".user_exists;
|
||||||
|
|
||||||
local function process_to_bare(bare, origin, stanza)
|
local function process_to_bare(bare, origin, stanza)
|
||||||
local user = bare_sessions[bare];
|
local user = bare_sessions[bare];
|
||||||
|
|
|
@ -6,13 +6,13 @@
|
||||||
-- COPYING file in the source package for more information.
|
-- COPYING file in the source package for more information.
|
||||||
--
|
--
|
||||||
|
|
||||||
local encodings = require "util.encodings";
|
local encodings = require "prosody.util.encodings";
|
||||||
assert(encodings.confusable, "This module requires that Prosody be built with ICU");
|
assert(encodings.confusable, "This module requires that Prosody be built with ICU");
|
||||||
local skeleton = encodings.confusable.skeleton;
|
local skeleton = encodings.confusable.skeleton;
|
||||||
|
|
||||||
local usage = require "util.prosodyctl".show_usage;
|
local usage = require "prosody.util.prosodyctl".show_usage;
|
||||||
local usermanager = require "core.usermanager";
|
local usermanager = require "prosody.core.usermanager";
|
||||||
local storagemanager = require "core.storagemanager";
|
local storagemanager = require "prosody.core.storagemanager";
|
||||||
|
|
||||||
local skeletons
|
local skeletons
|
||||||
function module.load()
|
function module.load()
|
||||||
|
|
|
@ -13,7 +13,7 @@ local motd_jid = module:get_option_string("motd_jid", host);
|
||||||
|
|
||||||
if not motd_text then return; end
|
if not motd_text then return; end
|
||||||
|
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
|
|
||||||
motd_text = motd_text:gsub("^%s*(.-)%s*$", "%1"):gsub("\n[ \t]+", "\n"); -- Strip indentation from the config
|
motd_text = motd_text:gsub("^%s*(.-)%s*$", "%1"):gsub("\n[ \t]+", "\n"); -- Strip indentation from the config
|
||||||
|
|
||||||
|
|
|
@ -16,22 +16,22 @@ local xmlns_st_id = "urn:xmpp:sid:0";
|
||||||
local xmlns_muc_user = "http://jabber.org/protocol/muc#user";
|
local xmlns_muc_user = "http://jabber.org/protocol/muc#user";
|
||||||
local muc_form_enable = "muc#roomconfig_enablearchiving"
|
local muc_form_enable = "muc#roomconfig_enablearchiving"
|
||||||
|
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local rsm = require "util.rsm";
|
local rsm = require "prosody.util.rsm";
|
||||||
local jid_bare = require "util.jid".bare;
|
local jid_bare = require "prosody.util.jid".bare;
|
||||||
local jid_split = require "util.jid".split;
|
local jid_split = require "prosody.util.jid".split;
|
||||||
local jid_prep = require "util.jid".prep;
|
local jid_prep = require "prosody.util.jid".prep;
|
||||||
local dataform = require "util.dataforms".new;
|
local dataform = require "prosody.util.dataforms".new;
|
||||||
local get_form_type = require "util.dataforms".get_type;
|
local get_form_type = require "prosody.util.dataforms".get_type;
|
||||||
|
|
||||||
local mod_muc = module:depends"muc";
|
local mod_muc = module:depends"muc";
|
||||||
local get_room_from_jid = mod_muc.get_room_from_jid;
|
local get_room_from_jid = mod_muc.get_room_from_jid;
|
||||||
|
|
||||||
local is_stanza = st.is_stanza;
|
local is_stanza = st.is_stanza;
|
||||||
local tostring = tostring;
|
local tostring = tostring;
|
||||||
local time_now = require "util.time".now;
|
local time_now = require "prosody.util.time".now;
|
||||||
local m_min = math.min;
|
local m_min = math.min;
|
||||||
local timestamp, datestamp = import("util.datetime", "datetime", "date");
|
local timestamp, datestamp = import("prosody.util.datetime", "datetime", "date");
|
||||||
local default_max_items, max_max_items = 20, module:get_option_number("max_archive_query_results", 50);
|
local default_max_items, max_max_items = 20, module:get_option_number("max_archive_query_results", 50);
|
||||||
|
|
||||||
local cleanup_after = module:get_option_string("muc_log_expires_after", "1w");
|
local cleanup_after = module:get_option_string("muc_log_expires_after", "1w");
|
||||||
|
@ -492,7 +492,7 @@ if cleanup_after ~= "never" then
|
||||||
-- messages, we collect the union of sets of rooms from dates that fall
|
-- messages, we collect the union of sets of rooms from dates that fall
|
||||||
-- outside the cleanup range.
|
-- outside the cleanup range.
|
||||||
|
|
||||||
local last_date = require "util.cache".new(module:get_option_number("muc_log_cleanup_date_cache_size", 1000));
|
local last_date = require "prosody.util.cache".new(module:get_option_number("muc_log_cleanup_date_cache_size", 1000));
|
||||||
if not ( archive.caps and archive.caps.wildcard_delete ) then
|
if not ( archive.caps and archive.caps.wildcard_delete ) then
|
||||||
function schedule_cleanup(roomname, date)
|
function schedule_cleanup(roomname, date)
|
||||||
date = date or datestamp();
|
date = date or datestamp();
|
||||||
|
@ -506,7 +506,7 @@ if cleanup_after ~= "never" then
|
||||||
|
|
||||||
local cleanup_time = module:measure("cleanup", "times");
|
local cleanup_time = module:measure("cleanup", "times");
|
||||||
|
|
||||||
local async = require "util.async";
|
local async = require "prosody.util.async";
|
||||||
module:daily("Remove expired messages", function ()
|
module:daily("Remove expired messages", function ()
|
||||||
local cleanup_done = cleanup_time();
|
local cleanup_done = cleanup_time();
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
-- XEP-0307: Unique Room Names for Multi-User Chat
|
-- XEP-0307: Unique Room Names for Multi-User Chat
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local unique_name = require "util.id".medium;
|
local unique_name = require "prosody.util.id".medium;
|
||||||
module:add_feature "http://jabber.org/protocol/muc#unique"
|
module:add_feature "http://jabber.org/protocol/muc#unique"
|
||||||
module:hook("iq-get/host/http://jabber.org/protocol/muc#unique:unique", function(event)
|
module:hook("iq-get/host/http://jabber.org/protocol/muc#unique:unique", function(event)
|
||||||
local origin, stanza = event.origin, event.stanza;
|
local origin, stanza = event.origin, event.stanza;
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
module:set_global();
|
module:set_global();
|
||||||
|
|
||||||
local array = require "util.array";
|
local array = require "prosody.util.array";
|
||||||
local max_buffer_len = module:get_option_number("multiplex_buffer_size", 1024);
|
local max_buffer_len = module:get_option_number("multiplex_buffer_size", 1024);
|
||||||
local default_mode = module:get_option_number("network_default_read_size", 4096);
|
local default_mode = module:get_option_number("network_default_read_size", 4096);
|
||||||
|
|
||||||
local portmanager = require "core.portmanager";
|
local portmanager = require "prosody.core.portmanager";
|
||||||
|
|
||||||
local available_services = {};
|
local available_services = {};
|
||||||
local service_by_protocol = {};
|
local service_by_protocol = {};
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
--
|
--
|
||||||
|
|
||||||
|
|
||||||
local datetime = require "util.datetime";
|
local datetime = require "prosody.util.datetime";
|
||||||
local jid_split = require "util.jid".split;
|
local jid_split = require "prosody.util.jid".split;
|
||||||
|
|
||||||
local offline_messages = module:open_store("offline", "archive");
|
local offline_messages = module:open_store("offline", "archive");
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
local pubsub = require "util.pubsub";
|
local pubsub = require "prosody.util.pubsub";
|
||||||
local jid_bare = require "util.jid".bare;
|
local jid_bare = require "prosody.util.jid".bare;
|
||||||
local jid_split = require "util.jid".split;
|
local jid_split = require "prosody.util.jid".split;
|
||||||
local jid_join = require "util.jid".join;
|
local jid_join = require "prosody.util.jid".join;
|
||||||
local set_new = require "util.set".new;
|
local set_new = require "prosody.util.set".new;
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local calculate_hash = require "util.caps".calculate_hash;
|
local calculate_hash = require "prosody.util.caps".calculate_hash;
|
||||||
local is_contact_subscribed = require "core.rostermanager".is_contact_subscribed;
|
local is_contact_subscribed = require "prosody.core.rostermanager".is_contact_subscribed;
|
||||||
local cache = require "util.cache";
|
local cache = require "prosody.util.cache";
|
||||||
local set = require "util.set";
|
local set = require "prosody.util.set";
|
||||||
local new_id = require "util.id".medium;
|
local new_id = require "prosody.util.id".medium;
|
||||||
local storagemanager = require "core.storagemanager";
|
local storagemanager = require "prosody.core.storagemanager";
|
||||||
local usermanager = require "core.usermanager";
|
local usermanager = require "prosody.core.usermanager";
|
||||||
|
|
||||||
local xmlns_pubsub = "http://jabber.org/protocol/pubsub";
|
local xmlns_pubsub = "http://jabber.org/protocol/pubsub";
|
||||||
local xmlns_pubsub_event = "http://jabber.org/protocol/pubsub#event";
|
local xmlns_pubsub_event = "http://jabber.org/protocol/pubsub#event";
|
||||||
|
|
|
@ -7,15 +7,15 @@
|
||||||
--
|
--
|
||||||
|
|
||||||
|
|
||||||
local jid_bare = require "util.jid".bare;
|
local jid_bare = require "prosody.util.jid".bare;
|
||||||
local jid_split = require "util.jid".split;
|
local jid_split = require "prosody.util.jid".split;
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local is_contact_subscribed = require "core.rostermanager".is_contact_subscribed;
|
local is_contact_subscribed = require "prosody.core.rostermanager".is_contact_subscribed;
|
||||||
local pairs = pairs;
|
local pairs = pairs;
|
||||||
local next = next;
|
local next = next;
|
||||||
local type = type;
|
local type = type;
|
||||||
local unpack = table.unpack;
|
local unpack = table.unpack;
|
||||||
local calculate_hash = require "util.caps".calculate_hash;
|
local calculate_hash = require "prosody.util.caps".calculate_hash;
|
||||||
local core_post_stanza = prosody.core_post_stanza;
|
local core_post_stanza = prosody.core_post_stanza;
|
||||||
local bare_sessions = prosody.bare_sessions;
|
local bare_sessions = prosody.bare_sessions;
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
-- COPYING file in the source package for more information.
|
-- COPYING file in the source package for more information.
|
||||||
--
|
--
|
||||||
|
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
|
|
||||||
module:add_feature("urn:xmpp:ping");
|
module:add_feature("urn:xmpp:ping");
|
||||||
|
|
||||||
|
|
|
@ -9,13 +9,13 @@
|
||||||
|
|
||||||
local want_pposix_version = "0.4.0";
|
local want_pposix_version = "0.4.0";
|
||||||
|
|
||||||
local pposix = assert(require "util.pposix");
|
local pposix = assert(require "prosody.util.pposix");
|
||||||
if pposix._VERSION ~= want_pposix_version then
|
if pposix._VERSION ~= want_pposix_version then
|
||||||
module:log("warn", "Unknown version (%s) of binary pposix module, expected %s."
|
module:log("warn", "Unknown version (%s) of binary pposix module, expected %s."
|
||||||
.. "Perhaps you need to recompile?", tostring(pposix._VERSION), want_pposix_version);
|
.. "Perhaps you need to recompile?", tostring(pposix._VERSION), want_pposix_version);
|
||||||
end
|
end
|
||||||
|
|
||||||
local have_signal, signal = pcall(require, "util.signal");
|
local have_signal, signal = pcall(require, "prosody.util.signal");
|
||||||
if not have_signal then
|
if not have_signal then
|
||||||
module:log("warn", "Couldn't load signal library, won't respond to SIGTERM");
|
module:log("warn", "Couldn't load signal library, won't respond to SIGTERM");
|
||||||
end
|
end
|
||||||
|
@ -97,7 +97,7 @@ if daemonize == nil then
|
||||||
end
|
end
|
||||||
|
|
||||||
local function remove_log_sinks()
|
local function remove_log_sinks()
|
||||||
local lm = require "core.loggingmanager";
|
local lm = require "prosody.core.loggingmanager";
|
||||||
lm.register_sink_type("console", nil);
|
lm.register_sink_type("console", nil);
|
||||||
lm.register_sink_type("stdout", nil);
|
lm.register_sink_type("stdout", nil);
|
||||||
lm.reload_logging();
|
lm.reload_logging();
|
||||||
|
|
|
@ -15,19 +15,19 @@ local tonumber = tonumber;
|
||||||
|
|
||||||
local core_post_stanza = prosody.core_post_stanza;
|
local core_post_stanza = prosody.core_post_stanza;
|
||||||
local core_process_stanza = prosody.core_process_stanza;
|
local core_process_stanza = prosody.core_process_stanza;
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local jid_split = require "util.jid".split;
|
local jid_split = require "prosody.util.jid".split;
|
||||||
local jid_bare = require "util.jid".bare;
|
local jid_bare = require "prosody.util.jid".bare;
|
||||||
local datetime = require "util.datetime";
|
local datetime = require "prosody.util.datetime";
|
||||||
local hosts = prosody.hosts;
|
local hosts = prosody.hosts;
|
||||||
local bare_sessions = prosody.bare_sessions;
|
local bare_sessions = prosody.bare_sessions;
|
||||||
local full_sessions = prosody.full_sessions;
|
local full_sessions = prosody.full_sessions;
|
||||||
local NULL = {};
|
local NULL = {};
|
||||||
|
|
||||||
local rostermanager = require "core.rostermanager";
|
local rostermanager = require "prosody.core.rostermanager";
|
||||||
local sessionmanager = require "core.sessionmanager";
|
local sessionmanager = require "prosody.core.sessionmanager";
|
||||||
|
|
||||||
local recalc_resource_map = require "util.presence".recalc_resource_map;
|
local recalc_resource_map = require "prosody.util.presence".recalc_resource_map;
|
||||||
|
|
||||||
local ignore_presence_priority = module:get_option_boolean("ignore_presence_priority", false);
|
local ignore_presence_priority = module:get_option_boolean("ignore_presence_priority", false);
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
--
|
--
|
||||||
|
|
||||||
|
|
||||||
local st = require "util.stanza"
|
local st = require "prosody.util.stanza"
|
||||||
|
|
||||||
local private_storage = module:open_store("private", "map");
|
local private_storage = module:open_store("private", "map");
|
||||||
|
|
||||||
|
|
|
@ -9,11 +9,11 @@
|
||||||
|
|
||||||
module:set_global();
|
module:set_global();
|
||||||
|
|
||||||
local jid_compare, jid_prep = require "util.jid".compare, require "util.jid".prep;
|
local jid_compare, jid_prep = require "prosody.util.jid".compare, require "prosody.util.jid".prep;
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local sha1 = require "util.hashes".sha1;
|
local sha1 = require "prosody.util.hashes".sha1;
|
||||||
local server = require "net.server";
|
local server = require "prosody.net.server";
|
||||||
local portmanager = require "core.portmanager";
|
local portmanager = require "prosody.core.portmanager";
|
||||||
|
|
||||||
local sessions = module:shared("sessions");
|
local sessions = module:shared("sessions");
|
||||||
local transfers = module:shared("transfers");
|
local transfers = module:shared("transfers");
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
local pubsub = require "util.pubsub";
|
local pubsub = require "prosody.util.pubsub";
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local jid_bare = require "util.jid".bare;
|
local jid_bare = require "prosody.util.jid".bare;
|
||||||
local new_id = require "util.id".medium;
|
local new_id = require "prosody.util.id".medium;
|
||||||
local storagemanager = require "core.storagemanager";
|
local storagemanager = require "prosody.core.storagemanager";
|
||||||
local xtemplate = require "util.xtemplate";
|
local xtemplate = require "prosody.util.xtemplate";
|
||||||
|
|
||||||
local xmlns_pubsub = "http://jabber.org/protocol/pubsub";
|
local xmlns_pubsub = "http://jabber.org/protocol/pubsub";
|
||||||
local xmlns_pubsub_event = "http://jabber.org/protocol/pubsub#event";
|
local xmlns_pubsub_event = "http://jabber.org/protocol/pubsub#event";
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
local t_unpack = table.unpack;
|
local t_unpack = table.unpack;
|
||||||
local time_now = os.time;
|
local time_now = os.time;
|
||||||
|
|
||||||
local jid_prep = require "util.jid".prep;
|
local jid_prep = require "prosody.util.jid".prep;
|
||||||
local set = require "util.set";
|
local set = require "prosody.util.set";
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local it = require "util.iterators";
|
local it = require "prosody.util.iterators";
|
||||||
local uuid_generate = require "util.uuid".generate;
|
local uuid_generate = require "prosody.util.uuid".generate;
|
||||||
local dataform = require"util.dataforms".new;
|
local dataform = require"prosody.util.dataforms".new;
|
||||||
local errors = require "util.error";
|
local errors = require "prosody.util.error";
|
||||||
|
|
||||||
local xmlns_pubsub = "http://jabber.org/protocol/pubsub";
|
local xmlns_pubsub = "http://jabber.org/protocol/pubsub";
|
||||||
local xmlns_pubsub_errors = "http://jabber.org/protocol/pubsub#errors";
|
local xmlns_pubsub_errors = "http://jabber.org/protocol/pubsub#errors";
|
||||||
|
|
|
@ -7,14 +7,14 @@
|
||||||
--
|
--
|
||||||
|
|
||||||
|
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local dataform_new = require "util.dataforms".new;
|
local dataform_new = require "prosody.util.dataforms".new;
|
||||||
local usermanager_user_exists = require "core.usermanager".user_exists;
|
local usermanager_user_exists = require "prosody.core.usermanager".user_exists;
|
||||||
local usermanager_create_user = require "core.usermanager".create_user;
|
local usermanager_create_user = require "prosody.core.usermanager".create_user;
|
||||||
local usermanager_set_password = require "core.usermanager".create_user;
|
local usermanager_set_password = require "prosody.core.usermanager".create_user;
|
||||||
local usermanager_delete_user = require "core.usermanager".delete_user;
|
local usermanager_delete_user = require "prosody.core.usermanager".delete_user;
|
||||||
local nodeprep = require "util.encodings".stringprep.nodeprep;
|
local nodeprep = require "prosody.util.encodings".stringprep.nodeprep;
|
||||||
local util_error = require "util.error";
|
local util_error = require "prosody.util.error";
|
||||||
|
|
||||||
local additional_fields = module:get_option("additional_registration_fields", {});
|
local additional_fields = module:get_option("additional_registration_fields", {});
|
||||||
local require_encryption = module:get_option_boolean("c2s_require_encryption",
|
local require_encryption = module:get_option_boolean("c2s_require_encryption",
|
||||||
|
|
|
@ -7,13 +7,13 @@
|
||||||
--
|
--
|
||||||
|
|
||||||
|
|
||||||
local create_throttle = require "util.throttle".create;
|
local create_throttle = require "prosody.util.throttle".create;
|
||||||
local new_cache = require "util.cache".new;
|
local new_cache = require "prosody.util.cache".new;
|
||||||
local ip_util = require "util.ip";
|
local ip_util = require "prosody.util.ip";
|
||||||
local new_ip = ip_util.new_ip;
|
local new_ip = ip_util.new_ip;
|
||||||
local match_ip = ip_util.match;
|
local match_ip = ip_util.match;
|
||||||
local parse_cidr = ip_util.parse_cidr;
|
local parse_cidr = ip_util.parse_cidr;
|
||||||
local errors = require "util.error";
|
local errors = require "prosody.util.error";
|
||||||
|
|
||||||
-- COMPAT drop old option names
|
-- COMPAT drop old option names
|
||||||
local min_seconds_between_registrations = module:get_option_number("min_seconds_between_registrations");
|
local min_seconds_between_registrations = module:get_option_number("min_seconds_between_registrations");
|
||||||
|
|
|
@ -7,18 +7,18 @@
|
||||||
--
|
--
|
||||||
|
|
||||||
|
|
||||||
local st = require "util.stanza"
|
local st = require "prosody.util.stanza"
|
||||||
|
|
||||||
local jid_split = require "util.jid".split;
|
local jid_split = require "prosody.util.jid".split;
|
||||||
local jid_resource = require "util.jid".resource;
|
local jid_resource = require "prosody.util.jid".resource;
|
||||||
local jid_prep = require "util.jid".prep;
|
local jid_prep = require "prosody.util.jid".prep;
|
||||||
local tonumber = tonumber;
|
local tonumber = tonumber;
|
||||||
local pairs = pairs;
|
local pairs = pairs;
|
||||||
|
|
||||||
local rm_load_roster = require "core.rostermanager".load_roster;
|
local rm_load_roster = require "prosody.core.rostermanager".load_roster;
|
||||||
local rm_remove_from_roster = require "core.rostermanager".remove_from_roster;
|
local rm_remove_from_roster = require "prosody.core.rostermanager".remove_from_roster;
|
||||||
local rm_add_to_roster = require "core.rostermanager".add_to_roster;
|
local rm_add_to_roster = require "prosody.core.rostermanager".add_to_roster;
|
||||||
local rm_roster_push = require "core.rostermanager".roster_push;
|
local rm_roster_push = require "prosody.core.rostermanager".roster_push;
|
||||||
|
|
||||||
module:add_feature("jabber:iq:roster");
|
module:add_feature("jabber:iq:roster");
|
||||||
|
|
||||||
|
|
|
@ -16,23 +16,23 @@ local tostring, type = tostring, type;
|
||||||
local t_insert = table.insert;
|
local t_insert = table.insert;
|
||||||
local traceback = debug.traceback;
|
local traceback = debug.traceback;
|
||||||
|
|
||||||
local add_task = require "util.timer".add_task;
|
local add_task = require "prosody.util.timer".add_task;
|
||||||
local stop_timer = require "util.timer".stop;
|
local stop_timer = require "prosody.util.timer".stop;
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local initialize_filters = require "util.filters".initialize;
|
local initialize_filters = require "prosody.util.filters".initialize;
|
||||||
local nameprep = require "util.encodings".stringprep.nameprep;
|
local nameprep = require "prosody.util.encodings".stringprep.nameprep;
|
||||||
local new_xmpp_stream = require "util.xmppstream".new;
|
local new_xmpp_stream = require "prosody.util.xmppstream".new;
|
||||||
local s2s_new_incoming = require "core.s2smanager".new_incoming;
|
local s2s_new_incoming = require "prosody.core.s2smanager".new_incoming;
|
||||||
local s2s_new_outgoing = require "core.s2smanager".new_outgoing;
|
local s2s_new_outgoing = require "prosody.core.s2smanager".new_outgoing;
|
||||||
local s2s_destroy_session = require "core.s2smanager".destroy_session;
|
local s2s_destroy_session = require "prosody.core.s2smanager".destroy_session;
|
||||||
local uuid_gen = require "util.uuid".generate;
|
local uuid_gen = require "prosody.util.uuid".generate;
|
||||||
local async = require "util.async";
|
local async = require "prosody.util.async";
|
||||||
local runner = async.runner;
|
local runner = async.runner;
|
||||||
local connect = require "net.connect".connect;
|
local connect = require "prosody.net.connect".connect;
|
||||||
local service = require "net.resolvers.service";
|
local service = require "prosody.net.resolvers.service";
|
||||||
local resolver_chain = require "net.resolvers.chain";
|
local resolver_chain = require "prosody.net.resolvers.chain";
|
||||||
local errors = require "util.error";
|
local errors = require "prosody.util.error";
|
||||||
local set = require "util.set";
|
local set = require "prosody.util.set";
|
||||||
|
|
||||||
local connect_timeout = module:get_option_number("s2s_timeout", 90);
|
local connect_timeout = module:get_option_number("s2s_timeout", 90);
|
||||||
local stream_close_timeout = module:get_option_number("s2s_close_timeout", 5);
|
local stream_close_timeout = module:get_option_number("s2s_close_timeout", 5);
|
||||||
|
@ -1007,7 +1007,7 @@ module:hook("s2s-check-certificate", check_auth_policy, -1);
|
||||||
|
|
||||||
module:hook("server-stopping", function(event)
|
module:hook("server-stopping", function(event)
|
||||||
-- Close ports
|
-- Close ports
|
||||||
local pm = require "core.portmanager";
|
local pm = require "prosody.core.portmanager";
|
||||||
for _, netservice in pairs(module.items["net-provider"]) do
|
for _, netservice in pairs(module.items["net-provider"]) do
|
||||||
pm.unregister_service(netservice.name, netservice);
|
pm.unregister_service(netservice.name, netservice);
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
module:set_global();
|
module:set_global();
|
||||||
|
|
||||||
local cert_verify_identity = require "util.x509".verify_identity;
|
local cert_verify_identity = require "prosody.util.x509".verify_identity;
|
||||||
local NULL = {};
|
local NULL = {};
|
||||||
local log = module._log;
|
local log = module._log;
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
-- COPYING file in the source package for more information.
|
-- COPYING file in the source package for more information.
|
||||||
--
|
--
|
||||||
|
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
|
|
||||||
local xmlns_bidi_feature = "urn:xmpp:features:bidi"
|
local xmlns_bidi_feature = "urn:xmpp:features:bidi"
|
||||||
local xmlns_bidi = "urn:xmpp:bidi";
|
local xmlns_bidi = "urn:xmpp:bidi";
|
||||||
|
|
|
@ -8,14 +8,14 @@
|
||||||
-- luacheck: ignore 431/log
|
-- luacheck: ignore 431/log
|
||||||
|
|
||||||
|
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local sm_bind_resource = require "core.sessionmanager".bind_resource;
|
local sm_bind_resource = require "prosody.core.sessionmanager".bind_resource;
|
||||||
local sm_make_authenticated = require "core.sessionmanager".make_authenticated;
|
local sm_make_authenticated = require "prosody.core.sessionmanager".make_authenticated;
|
||||||
local base64 = require "util.encodings".base64;
|
local base64 = require "prosody.util.encodings".base64;
|
||||||
local set = require "util.set";
|
local set = require "prosody.util.set";
|
||||||
local errors = require "util.error";
|
local errors = require "prosody.util.error";
|
||||||
|
|
||||||
local usermanager_get_sasl_handler = require "core.usermanager".get_sasl_handler;
|
local usermanager_get_sasl_handler = require "prosody.core.usermanager".get_sasl_handler;
|
||||||
|
|
||||||
local secure_auth_only = module:get_option_boolean("c2s_require_encryption", module:get_option_boolean("require_encryption", true));
|
local secure_auth_only = module:get_option_boolean("c2s_require_encryption", module:get_option_boolean("require_encryption", true));
|
||||||
local allow_unencrypted_plain_auth = module:get_option_boolean("allow_unencrypted_plain_auth", false)
|
local allow_unencrypted_plain_auth = module:get_option_boolean("allow_unencrypted_plain_auth", false)
|
||||||
|
|
|
@ -2,11 +2,11 @@ local names = { "Romeo", "Juliet", "Mercutio", "Tybalt", "Benvolio" };
|
||||||
local devices = { "", "phone", "laptop", "tablet", "toaster", "fridge", "shoe" };
|
local devices = { "", "phone", "laptop", "tablet", "toaster", "fridge", "shoe" };
|
||||||
local users = {};
|
local users = {};
|
||||||
|
|
||||||
local filters = require "util.filters";
|
local filters = require "prosody.util.filters";
|
||||||
local id = require "util.id";
|
local id = require "prosody.util.id";
|
||||||
local dt = require "util.datetime";
|
local dt = require "prosody.util.datetime";
|
||||||
local dm = require "util.datamanager";
|
local dm = require "prosody.util.datamanager";
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
|
|
||||||
local record_id = id.short():lower();
|
local record_id = id.short():lower();
|
||||||
local record_date = os.date("%Y%b%d"):lower();
|
local record_date = os.date("%Y%b%d"):lower();
|
||||||
|
|
|
@ -6,12 +6,12 @@
|
||||||
-- COPYING file in the source package for more information.
|
-- COPYING file in the source package for more information.
|
||||||
--
|
--
|
||||||
|
|
||||||
local array = require "util.array";
|
local array = require "prosody.util.array";
|
||||||
local jid = require "util.jid";
|
local jid = require "prosody.util.jid";
|
||||||
local url = require "socket.url";
|
local url = require "socket.url";
|
||||||
|
|
||||||
-- Source: http://xmpp.org/registrar/formtypes.html#http:--jabber.org-network-serverinfo
|
-- Source: http://xmpp.org/registrar/formtypes.html#http:--jabber.org-network-serverinfo
|
||||||
local form_layout = require "util.dataforms".new({
|
local form_layout = require "prosody.util.dataforms".new({
|
||||||
{ var = "FORM_TYPE"; type = "hidden"; value = "http://jabber.org/network/serverinfo"; };
|
{ var = "FORM_TYPE"; type = "hidden"; value = "http://jabber.org/network/serverinfo"; };
|
||||||
{ name = "abuse", var = "abuse-addresses", type = "list-multi" },
|
{ name = "abuse", var = "abuse-addresses", type = "list-multi" },
|
||||||
{ name = "admin", var = "admin-addresses", type = "list-multi" },
|
{ name = "admin", var = "admin-addresses", type = "list-multi" },
|
||||||
|
|
|
@ -45,17 +45,17 @@ local sessions_expired = module:measure("sessions_expired", "counter");
|
||||||
local sessions_started = module:measure("sessions_started", "counter");
|
local sessions_started = module:measure("sessions_started", "counter");
|
||||||
|
|
||||||
|
|
||||||
local datetime = require "util.datetime";
|
local datetime = require "prosody.util.datetime";
|
||||||
local add_filter = require "util.filters".add_filter;
|
local add_filter = require "prosody.util.filters".add_filter;
|
||||||
local jid = require "util.jid";
|
local jid = require "prosody.util.jid";
|
||||||
local smqueue = require "util.smqueue";
|
local smqueue = require "prosody.util.smqueue";
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local timer = require "util.timer";
|
local timer = require "prosody.util.timer";
|
||||||
local new_id = require "util.id".short;
|
local new_id = require "prosody.util.id".short;
|
||||||
local watchdog = require "util.watchdog";
|
local watchdog = require "prosody.util.watchdog";
|
||||||
local it = require"util.iterators";
|
local it = require"prosody.util.iterators";
|
||||||
|
|
||||||
local sessionmanager = require "core.sessionmanager";
|
local sessionmanager = require "prosody.core.sessionmanager";
|
||||||
|
|
||||||
local xmlns_errors = "urn:ietf:params:xml:ns:xmpp-stanzas";
|
local xmlns_errors = "urn:ietf:params:xml:ns:xmpp-stanzas";
|
||||||
local xmlns_delay = "urn:xmpp:delay";
|
local xmlns_delay = "urn:xmpp:delay";
|
||||||
|
@ -104,14 +104,14 @@ local function clear_old_session(session, id)
|
||||||
return old_session_registry:set(session.username, id or session.resumption_token, nil)
|
return old_session_registry:set(session.username, id or session.resumption_token, nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
local ack_errors = require"util.error".init("mod_smacks", xmlns_sm3, {
|
local ack_errors = require"prosody.util.error".init("mod_smacks", xmlns_sm3, {
|
||||||
head = { condition = "undefined-condition"; text = "Client acknowledged more stanzas than sent by server" };
|
head = { condition = "undefined-condition"; text = "Client acknowledged more stanzas than sent by server" };
|
||||||
tail = { condition = "undefined-condition"; text = "Client acknowledged less stanzas than already acknowledged" };
|
tail = { condition = "undefined-condition"; text = "Client acknowledged less stanzas than already acknowledged" };
|
||||||
pop = { condition = "internal-server-error"; text = "Something went wrong with Stream Management" };
|
pop = { condition = "internal-server-error"; text = "Something went wrong with Stream Management" };
|
||||||
overflow = { condition = "resource-constraint", text = "Too many unacked stanzas remaining, session can't be resumed" }
|
overflow = { condition = "resource-constraint", text = "Too many unacked stanzas remaining, session can't be resumed" }
|
||||||
});
|
});
|
||||||
|
|
||||||
local enable_errors = require "util.error".init("mod_smacks", xmlns_sm3, {
|
local enable_errors = require "prosody.util.error".init("mod_smacks", xmlns_sm3, {
|
||||||
already_enabled = { condition = "unexpected-request", text = "Stream management is already enabled" };
|
already_enabled = { condition = "unexpected-request", text = "Stream management is already enabled" };
|
||||||
bind_required = { condition = "unexpected-request", text = "Client must bind a resource before enabling stream management" };
|
bind_required = { condition = "unexpected-request", text = "Client must bind a resource before enabling stream management" };
|
||||||
unavailable = { condition = "service-unavailable", text = "Stream management is not available for this stream" };
|
unavailable = { condition = "service-unavailable", text = "Stream management is not available for this stream" };
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
module:set_global();
|
module:set_global();
|
||||||
|
|
||||||
local filters = require "util.filters";
|
local filters = require "prosody.util.filters";
|
||||||
|
|
||||||
local function log_send(t, session)
|
local function log_send(t, session)
|
||||||
if t and t ~= "" and t ~= " " then
|
if t and t ~= "" and t ~= " " then
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
local cache = require "util.cache";
|
local cache = require "prosody.util.cache";
|
||||||
local datamanager = require "core.storagemanager".olddm;
|
local datamanager = require "prosody.core.storagemanager".olddm;
|
||||||
local array = require "util.array";
|
local array = require "prosody.util.array";
|
||||||
local datetime = require "util.datetime";
|
local datetime = require "prosody.util.datetime";
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local now = require "util.time".now;
|
local now = require "prosody.util.time".now;
|
||||||
local id = require "util.id".medium;
|
local id = require "prosody.util.id".medium;
|
||||||
local jid_join = require "util.jid".join;
|
local jid_join = require "prosody.util.jid".join;
|
||||||
local set = require "util.set";
|
local set = require "prosody.util.set";
|
||||||
|
|
||||||
local host = module.host;
|
local host = module.host;
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
local serialize = require "util.serialization".serialize;
|
local serialize = require "prosody.util.serialization".serialize;
|
||||||
local array = require "util.array";
|
local array = require "prosody.util.array";
|
||||||
local envload = require "util.envload".envload;
|
local envload = require "prosody.util.envload".envload;
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local is_stanza = st.is_stanza or function (s) return getmetatable(s) == st.stanza_mt end
|
local is_stanza = st.is_stanza or function (s) return getmetatable(s) == st.stanza_mt end
|
||||||
local new_id = require "util.id".medium;
|
local new_id = require "prosody.util.id".medium;
|
||||||
local set = require "util.set";
|
local set = require "prosody.util.set";
|
||||||
|
|
||||||
local auto_purge_enabled = module:get_option_boolean("storage_memory_temporary", false);
|
local auto_purge_enabled = module:get_option_boolean("storage_memory_temporary", false);
|
||||||
local auto_purge_stores = module:get_option_set("storage_memory_temporary_stores", {});
|
local auto_purge_stores = module:get_option_set("storage_memory_temporary_stores", {});
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
|
|
||||||
-- luacheck: ignore 212/self
|
-- luacheck: ignore 212/self
|
||||||
|
|
||||||
local deps = require "util.dependencies";
|
local deps = require "prosody.util.dependencies";
|
||||||
local cache = require "util.cache";
|
local cache = require "prosody.util.cache";
|
||||||
local json = require "util.json";
|
local json = require "prosody.util.json";
|
||||||
local sqlite = deps.softreq "util.sqlite3";
|
local sqlite = deps.softreq "prosody.util.sqlite3";
|
||||||
local dbisql = (sqlite and deps.softreq or require) "util.sql";
|
local dbisql = (sqlite and deps.softreq or require) "prosody.util.sql";
|
||||||
local xml_parse = require "util.xml".parse;
|
local xml_parse = require "prosody.util.xml".parse;
|
||||||
local uuid = require "util.uuid";
|
local uuid = require "prosody.util.uuid";
|
||||||
local resolve_relative_path = require "util.paths".resolve_relative_path;
|
local resolve_relative_path = require "prosody.util.paths".resolve_relative_path;
|
||||||
local jid_join = require "util.jid".join;
|
local jid_join = require "prosody.util.jid".join;
|
||||||
|
|
||||||
local is_stanza = require"util.stanza".is_stanza;
|
local is_stanza = require"prosody.util.stanza".is_stanza;
|
||||||
local t_concat = table.concat;
|
local t_concat = table.concat;
|
||||||
|
|
||||||
local noop = function() end
|
local noop = function() end
|
||||||
|
@ -871,8 +871,8 @@ function module.load()
|
||||||
end
|
end
|
||||||
|
|
||||||
function module.command(arg)
|
function module.command(arg)
|
||||||
local config = require "core.configmanager";
|
local config = require "prosody.core.configmanager";
|
||||||
local hi = require "util.human.io";
|
local hi = require "prosody.util.human.io";
|
||||||
local command = table.remove(arg, 1);
|
local command = table.remove(arg, 1);
|
||||||
if command == "upgrade" then
|
if command == "upgrade" then
|
||||||
-- We need to find every unique dburi in the config
|
-- We need to find every unique dburi in the config
|
||||||
|
|
|
@ -5,19 +5,19 @@ local tostring = tostring;
|
||||||
local next, unpack = next, table.unpack;
|
local next, unpack = next, table.unpack;
|
||||||
local os_remove = os.remove;
|
local os_remove = os.remove;
|
||||||
local io_open = io.open;
|
local io_open = io.open;
|
||||||
local jid_bare = require "util.jid".bare;
|
local jid_bare = require "prosody.util.jid".bare;
|
||||||
local jid_prep = require "util.jid".prep;
|
local jid_prep = require "prosody.util.jid".prep;
|
||||||
local jid_join = require "util.jid".join;
|
local jid_join = require "prosody.util.jid".join;
|
||||||
|
|
||||||
local array = require "util.array";
|
local array = require "prosody.util.array";
|
||||||
local base64 = require "util.encodings".base64;
|
local base64 = require "prosody.util.encodings".base64;
|
||||||
local dt = require "util.datetime";
|
local dt = require "prosody.util.datetime";
|
||||||
local hex = require "util.hex";
|
local hex = require "prosody.util.hex";
|
||||||
local it = require "util.iterators";
|
local it = require "prosody.util.iterators";
|
||||||
local paths = require"util.paths";
|
local paths = require"prosody.util.paths";
|
||||||
local set = require "util.set";
|
local set = require "prosody.util.set";
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local parse_xml_real = require "util.xml".parse;
|
local parse_xml_real = require "prosody.util.xml".parse;
|
||||||
|
|
||||||
local lfs = require "lfs";
|
local lfs = require "lfs";
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
-- COPYING file in the source package for more information.
|
-- COPYING file in the source package for more information.
|
||||||
--
|
--
|
||||||
|
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local datetime = require "util.datetime".datetime;
|
local datetime = require "prosody.util.datetime".datetime;
|
||||||
local now = require "util.time".now;
|
local now = require "prosody.util.time".now;
|
||||||
|
|
||||||
-- XEP-0202: Entity Time
|
-- XEP-0202: Entity Time
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
-- COPYING file in the source package for more information.
|
-- COPYING file in the source package for more information.
|
||||||
--
|
--
|
||||||
|
|
||||||
local create_context = require "core.certmanager".create_context;
|
local create_context = require "prosody.core.certmanager".create_context;
|
||||||
local rawgetopt = require"core.configmanager".rawget;
|
local rawgetopt = require"prosody.core.configmanager".rawget;
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
|
|
||||||
local c2s_require_encryption = module:get_option("c2s_require_encryption", module:get_option("require_encryption", true));
|
local c2s_require_encryption = module:get_option("c2s_require_encryption", module:get_option("require_encryption", true));
|
||||||
local s2s_require_encryption = module:get_option("s2s_require_encryption", true);
|
local s2s_require_encryption = module:get_option("s2s_require_encryption", true);
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
local base64 = require "util.encodings".base64;
|
local base64 = require "prosody.util.encodings".base64;
|
||||||
local hashes = require "util.hashes";
|
local hashes = require "prosody.util.hashes";
|
||||||
local id = require "util.id";
|
local id = require "prosody.util.id";
|
||||||
local jid = require "util.jid";
|
local jid = require "prosody.util.jid";
|
||||||
local random = require "util.random";
|
local random = require "prosody.util.random";
|
||||||
local usermanager = require "core.usermanager";
|
local usermanager = require "prosody.core.usermanager";
|
||||||
local generate_identifier = require "util.id".short;
|
local generate_identifier = require "prosody.util.id".short;
|
||||||
|
|
||||||
local token_store = module:open_store("auth_tokens", "map");
|
local token_store = module:open_store("auth_tokens", "map");
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
-- TODO warn when trying to create an user before the tombstone expires
|
-- TODO warn when trying to create an user before the tombstone expires
|
||||||
-- e.g. via telnet or other admin interface
|
-- e.g. via telnet or other admin interface
|
||||||
local datetime = require "util.datetime";
|
local datetime = require "prosody.util.datetime";
|
||||||
local errors = require "util.error";
|
local errors = require "prosody.util.error";
|
||||||
local jid_node = require"util.jid".node;
|
local jid_node = require"prosody.util.jid".node;
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
|
|
||||||
-- Using a map store as key-value store so that removal of all user data
|
-- Using a map store as key-value store so that removal of all user data
|
||||||
-- does not also remove the tombstone, which would defeat the point
|
-- does not also remove the tombstone, which would defeat the point
|
||||||
local graveyard = module:open_store(nil, "map");
|
local graveyard = module:open_store(nil, "map");
|
||||||
local graveyard_cache = require "util.cache".new(module:get_option_number("tombstone_cache_size", 1024));
|
local graveyard_cache = require "prosody.util.cache".new(module:get_option_number("tombstone_cache_size", 1024));
|
||||||
|
|
||||||
local ttl = module:get_option_number("user_tombstone_expiry", nil);
|
local ttl = module:get_option_number("user_tombstone_expiry", nil);
|
||||||
-- Keep tombstones forever by default
|
-- Keep tombstones forever by default
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
local set = require "util.set";
|
local set = require "prosody.util.set";
|
||||||
|
|
||||||
local secret = module:get_option_string("turn_external_secret");
|
local secret = module:get_option_string("turn_external_secret");
|
||||||
local host = module:get_option_string("turn_external_host", module.host);
|
local host = module:get_option_string("turn_external_host", module.host);
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
-- COPYING file in the source package for more information.
|
-- COPYING file in the source package for more information.
|
||||||
--
|
--
|
||||||
|
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
|
|
||||||
local start_time = prosody.start_time;
|
local start_time = prosody.start_time;
|
||||||
module:hook_global("server-started", function() start_time = prosody.start_time end);
|
module:hook_global("server-started", function() start_time = prosody.start_time end);
|
||||||
|
|
|
@ -7,11 +7,11 @@
|
||||||
--
|
--
|
||||||
|
|
||||||
|
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local usermanager_set_password = require "core.usermanager".set_password;
|
local usermanager_set_password = require "prosody.core.usermanager".set_password;
|
||||||
local usermanager_delete_user = require "core.usermanager".delete_user;
|
local usermanager_delete_user = require "prosody.core.usermanager".delete_user;
|
||||||
local nodeprep = require "util.encodings".stringprep.nodeprep;
|
local nodeprep = require "prosody.util.encodings".stringprep.nodeprep;
|
||||||
local jid_bare = require "util.jid".bare;
|
local jid_bare = require "prosody.util.jid".bare;
|
||||||
|
|
||||||
local compat = module:get_option_boolean("registration_compat", true);
|
local compat = module:get_option_boolean("registration_compat", true);
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
-- COPYING file in the source package for more information.
|
-- COPYING file in the source package for more information.
|
||||||
--
|
--
|
||||||
|
|
||||||
local st = require "util.stanza"
|
local st = require "prosody.util.stanza"
|
||||||
local jid_split = require "util.jid".split;
|
local jid_split = require "prosody.util.jid".split;
|
||||||
|
|
||||||
local vcards = module:open_store();
|
local vcards = module:open_store();
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
local st = require "util.stanza"
|
local st = require "prosody.util.stanza"
|
||||||
local jid_split = require "util.jid".split;
|
local jid_split = require "prosody.util.jid".split;
|
||||||
|
|
||||||
local mod_pep = module:depends("pep");
|
local mod_pep = module:depends("pep");
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local jid_split = require "util.jid".split;
|
local jid_split = require "prosody.util.jid".split;
|
||||||
|
|
||||||
local mod_pep = module:depends("pep");
|
local mod_pep = module:depends("pep");
|
||||||
|
|
||||||
local sha1 = require "util.hashes".sha1;
|
local sha1 = require "prosody.util.hashes".sha1;
|
||||||
local base64_decode = require "util.encodings".base64.decode;
|
local base64_decode = require "prosody.util.encodings".base64.decode;
|
||||||
|
|
||||||
local vcards = module:open_store("vcard");
|
local vcards = module:open_store("vcard");
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
-- COPYING file in the source package for more information.
|
-- COPYING file in the source package for more information.
|
||||||
--
|
--
|
||||||
|
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
|
|
||||||
module:add_feature("jabber:iq:version");
|
module:add_feature("jabber:iq:version");
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ if not module:get_option_boolean("hide_os_type") then
|
||||||
platform = "Windows";
|
platform = "Windows";
|
||||||
else
|
else
|
||||||
local os_version_command = module:get_option_string("os_version_command");
|
local os_version_command = module:get_option_string("os_version_command");
|
||||||
local ok, pposix = pcall(require, "util.pposix");
|
local ok, pposix = pcall(require, "prosody.util.pposix");
|
||||||
if not os_version_command and (ok and pposix and pposix.uname) then
|
if not os_version_command and (ok and pposix and pposix.uname) then
|
||||||
platform = pposix.uname().sysname;
|
platform = pposix.uname().sysname;
|
||||||
end
|
end
|
||||||
|
|
|
@ -8,14 +8,14 @@
|
||||||
|
|
||||||
|
|
||||||
local host = module:get_host();
|
local host = module:get_host();
|
||||||
local jid_prep = require "util.jid".prep;
|
local jid_prep = require "prosody.util.jid".prep;
|
||||||
|
|
||||||
local registration_watchers = module:get_option_set("registration_watchers", module:get_option("admins", {})) / jid_prep;
|
local registration_watchers = module:get_option_set("registration_watchers", module:get_option("admins", {})) / jid_prep;
|
||||||
local registration_from = module:get_option_string("registration_from", host);
|
local registration_from = module:get_option_string("registration_from", host);
|
||||||
local registration_notification = module:get_option_string("registration_notification", "User $username just registered on $host from $ip");
|
local registration_notification = module:get_option_string("registration_notification", "User $username just registered on $host from $ip");
|
||||||
local msg_type = module:get_option_string("registration_notification_type", "chat");
|
local msg_type = module:get_option_string("registration_notification_type", "chat");
|
||||||
|
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
|
|
||||||
module:hook("user-registered", function (user)
|
module:hook("user-registered", function (user)
|
||||||
module:log("debug", "Notifying of new registration");
|
module:log("debug", "Notifying of new registration");
|
||||||
|
|
|
@ -8,19 +8,19 @@
|
||||||
|
|
||||||
module:set_global();
|
module:set_global();
|
||||||
|
|
||||||
local add_task = require "util.timer".add_task;
|
local add_task = require "prosody.util.timer".add_task;
|
||||||
local add_filter = require "util.filters".add_filter;
|
local add_filter = require "prosody.util.filters".add_filter;
|
||||||
local sha1 = require "util.hashes".sha1;
|
local sha1 = require "prosody.util.hashes".sha1;
|
||||||
local base64 = require "util.encodings".base64.encode;
|
local base64 = require "prosody.util.encodings".base64.encode;
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local parse_xml = require "util.xml".parse;
|
local parse_xml = require "prosody.util.xml".parse;
|
||||||
local contains_token = require "util.http".contains_token;
|
local contains_token = require "prosody.util.http".contains_token;
|
||||||
local portmanager = require "core.portmanager";
|
local portmanager = require "prosody.core.portmanager";
|
||||||
local sm_destroy_session = require"core.sessionmanager".destroy_session;
|
local sm_destroy_session = require"prosody.core.sessionmanager".destroy_session;
|
||||||
local log = module._log;
|
local log = module._log;
|
||||||
local dbuffer = require "util.dbuffer";
|
local dbuffer = require "prosody.util.dbuffer";
|
||||||
|
|
||||||
local websocket_frames = require"net.websocket.frames";
|
local websocket_frames = require"prosody.net.websocket.frames";
|
||||||
local parse_frame = websocket_frames.parse;
|
local parse_frame = websocket_frames.parse;
|
||||||
local build_frame = websocket_frames.build;
|
local build_frame = websocket_frames.build;
|
||||||
local build_close = websocket_frames.build_close;
|
local build_close = websocket_frames.build_close;
|
||||||
|
@ -370,6 +370,6 @@ function module.add_host(module)
|
||||||
module:hook("c2s-read-timeout", keepalive, -0.9);
|
module:hook("c2s-read-timeout", keepalive, -0.9);
|
||||||
end
|
end
|
||||||
|
|
||||||
if require"core.modulemanager".get_modules_for_host("*"):contains(module.name) then
|
if require"prosody.core.modulemanager".get_modules_for_host("*"):contains(module.name) then
|
||||||
module:add_host();
|
module:add_host();
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
local host = module:get_host();
|
local host = module:get_host();
|
||||||
local welcome_text = module:get_option_string("welcome_message", "Hello $username, welcome to the $host IM server!");
|
local welcome_text = module:get_option_string("welcome_message", "Hello $username, welcome to the $host IM server!");
|
||||||
|
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
|
|
||||||
module:hook("user-registered",
|
module:hook("user-registered",
|
||||||
function (user)
|
function (user)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local muc_util = module:require "muc/util";
|
local muc_util = module:require "muc/util";
|
||||||
|
|
||||||
local xmlns_hats = "xmpp:prosody.im/protocol/hats:1";
|
local xmlns_hats = "xmpp:prosody.im/protocol/hats:1";
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
--
|
--
|
||||||
|
|
||||||
local gettime = os.time;
|
local gettime = os.time;
|
||||||
local datetime = require "util.datetime";
|
local datetime = require "prosody.util.datetime";
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
|
|
||||||
local default_history_length = 20;
|
local default_history_length = 20;
|
||||||
local max_history_length = module:get_option_number("max_history_messages", math.huge);
|
local max_history_length = module:get_option_number("max_history_messages", math.huge);
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
-- COPYING file in the source package for more information.
|
-- COPYING file in the source package for more information.
|
||||||
--
|
--
|
||||||
|
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
|
|
||||||
local lock_rooms = module:get_option_boolean("muc_room_locking", true);
|
local lock_rooms = module:get_option_boolean("muc_room_locking", true);
|
||||||
local lock_room_timeout = module:get_option_number("muc_room_lock_timeout", 300);
|
local lock_room_timeout = module:get_option_number("muc_room_lock_timeout", 300);
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
-- COPYING file in the source package for more information.
|
-- COPYING file in the source package for more information.
|
||||||
--
|
--
|
||||||
|
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
|
|
||||||
local muc_util = module:require "muc/util";
|
local muc_util = module:require "muc/util";
|
||||||
local valid_affiliations = muc_util.valid_affiliations;
|
local valid_affiliations = muc_util.valid_affiliations;
|
||||||
|
|
|
@ -95,11 +95,11 @@ local occupant_id = module:require "muc/occupant_id";
|
||||||
room_mt.get_salt = occupant_id.get_room_salt;
|
room_mt.get_salt = occupant_id.get_room_salt;
|
||||||
room_mt.get_occupant_id = occupant_id.get_occupant_id;
|
room_mt.get_occupant_id = occupant_id.get_occupant_id;
|
||||||
|
|
||||||
local jid_split = require "util.jid".split;
|
local jid_split = require "prosody.util.jid".split;
|
||||||
local jid_prep = require "util.jid".prep;
|
local jid_prep = require "prosody.util.jid".prep;
|
||||||
local jid_bare = require "util.jid".bare;
|
local jid_bare = require "prosody.util.jid".bare;
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local cache = require "util.cache";
|
local cache = require "prosody.util.cache";
|
||||||
|
|
||||||
module:require "muc/config_form_sections";
|
module:require "muc/config_form_sections";
|
||||||
|
|
||||||
|
@ -506,10 +506,10 @@ do -- Ad-hoc commands
|
||||||
module:depends "adhoc";
|
module:depends "adhoc";
|
||||||
local t_concat = table.concat;
|
local t_concat = table.concat;
|
||||||
local adhoc_new = module:require "adhoc".new;
|
local adhoc_new = module:require "adhoc".new;
|
||||||
local adhoc_initial = require "util.adhoc".new_initial_data_form;
|
local adhoc_initial = require "prosody.util.adhoc".new_initial_data_form;
|
||||||
local adhoc_simple = require "util.adhoc".new_simple_form;
|
local adhoc_simple = require "prosody.util.adhoc".new_simple_form;
|
||||||
local array = require "util.array";
|
local array = require "prosody.util.array";
|
||||||
local dataforms_new = require "util.dataforms".new;
|
local dataforms_new = require "prosody.util.dataforms".new;
|
||||||
|
|
||||||
local destroy_rooms_layout = dataforms_new {
|
local destroy_rooms_layout = dataforms_new {
|
||||||
title = "Destroy rooms";
|
title = "Destroy rooms";
|
||||||
|
|
|
@ -12,18 +12,18 @@ local pairs = pairs;
|
||||||
local next = next;
|
local next = next;
|
||||||
local setmetatable = setmetatable;
|
local setmetatable = setmetatable;
|
||||||
|
|
||||||
local dataform = require "util.dataforms";
|
local dataform = require "prosody.util.dataforms";
|
||||||
local iterators = require "util.iterators";
|
local iterators = require "prosody.util.iterators";
|
||||||
local jid_split = require "util.jid".split;
|
local jid_split = require "prosody.util.jid".split;
|
||||||
local jid_bare = require "util.jid".bare;
|
local jid_bare = require "prosody.util.jid".bare;
|
||||||
local jid_prep = require "util.jid".prep;
|
local jid_prep = require "prosody.util.jid".prep;
|
||||||
local jid_join = require "util.jid".join;
|
local jid_join = require "prosody.util.jid".join;
|
||||||
local jid_resource = require "util.jid".resource;
|
local jid_resource = require "prosody.util.jid".resource;
|
||||||
local resourceprep = require "util.encodings".stringprep.resourceprep;
|
local resourceprep = require "prosody.util.encodings".stringprep.resourceprep;
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local base64 = require "util.encodings".base64;
|
local base64 = require "prosody.util.encodings".base64;
|
||||||
local hmac_sha256 = require "util.hashes".hmac_sha256;
|
local hmac_sha256 = require "prosody.util.hashes".hmac_sha256;
|
||||||
local new_id = require "util.id".medium;
|
local new_id = require "prosody.util.id".medium;
|
||||||
|
|
||||||
local log = module._log;
|
local log = module._log;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
local pairs = pairs;
|
local pairs = pairs;
|
||||||
local setmetatable = setmetatable;
|
local setmetatable = setmetatable;
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local util = module:require "muc/util";
|
local util = module:require "muc/util";
|
||||||
|
|
||||||
local function get_filtered_presence(stanza)
|
local function get_filtered_presence(stanza)
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
-- (C) 2020 Maxime “pep” Buquet <pep@bouah.net>
|
-- (C) 2020 Maxime “pep” Buquet <pep@bouah.net>
|
||||||
-- (C) 2020 Matthew Wild <mwild1@gmail.com>
|
-- (C) 2020 Matthew Wild <mwild1@gmail.com>
|
||||||
|
|
||||||
local uuid = require "util.uuid";
|
local uuid = require "prosody.util.uuid";
|
||||||
local hmac_sha256 = require "util.hashes".hmac_sha256;
|
local hmac_sha256 = require "prosody.util.hashes".hmac_sha256;
|
||||||
local b64encode = require "util.encodings".base64.encode;
|
local b64encode = require "prosody.util.encodings".base64.encode;
|
||||||
|
|
||||||
local xmlns_occupant_id = "urn:xmpp:occupant-id:0";
|
local xmlns_occupant_id = "urn:xmpp:occupant-id:0";
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
-- COPYING file in the source package for more information.
|
-- COPYING file in the source package for more information.
|
||||||
--
|
--
|
||||||
|
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
|
|
||||||
local function get_password(room)
|
local function get_password(room)
|
||||||
return room._data.password;
|
return room._data.password;
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
-- COPYING file in the source package for more information.
|
-- COPYING file in the source package for more information.
|
||||||
--
|
--
|
||||||
|
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
|
|
||||||
local valid_roles = { "none", "visitor", "participant", "moderator" };
|
local valid_roles = { "none", "visitor", "participant", "moderator" };
|
||||||
local default_broadcast = {
|
local default_broadcast = {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
local jid_bare = require "util.jid".bare;
|
local jid_bare = require "prosody.util.jid".bare;
|
||||||
local jid_resource = require "util.jid".resource;
|
local jid_resource = require "prosody.util.jid".resource;
|
||||||
local resourceprep = require "util.encodings".stringprep.resourceprep;
|
local resourceprep = require "prosody.util.encodings".stringprep.resourceprep;
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local dataforms = require "util.dataforms";
|
local dataforms = require "prosody.util.dataforms";
|
||||||
|
|
||||||
local allow_unaffiliated = module:get_option_boolean("allow_unaffiliated_register", false);
|
local allow_unaffiliated = module:get_option_boolean("allow_unaffiliated_register", false);
|
||||||
|
|
||||||
|
|
|
@ -7,14 +7,14 @@
|
||||||
-- COPYING file in the source package for more information.
|
-- COPYING file in the source package for more information.
|
||||||
--
|
--
|
||||||
|
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local jid_resource = require "util.jid".resource;
|
local jid_resource = require "prosody.util.jid".resource;
|
||||||
|
|
||||||
module:hook("muc-disco#info", function(event)
|
module:hook("muc-disco#info", function(event)
|
||||||
event.reply:tag("feature", {var = "http://jabber.org/protocol/muc#request"}):up();
|
event.reply:tag("feature", {var = "http://jabber.org/protocol/muc#request"}):up();
|
||||||
end);
|
end);
|
||||||
|
|
||||||
local voice_request_form = require "util.dataforms".new({
|
local voice_request_form = require "prosody.util.dataforms".new({
|
||||||
title = "Voice Request";
|
title = "Voice Request";
|
||||||
{
|
{
|
||||||
name = "FORM_TYPE";
|
name = "FORM_TYPE";
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
-- COPYING file in the source package for more information.
|
-- COPYING file in the source package for more information.
|
||||||
--
|
--
|
||||||
|
|
||||||
local st = require "util.stanza";
|
local st = require "prosody.util.stanza";
|
||||||
local dt = require "util.datetime";
|
local dt = require "prosody.util.datetime";
|
||||||
|
|
||||||
local muc_util = module:require "muc/util";
|
local muc_util = module:require "muc/util";
|
||||||
local valid_roles = muc_util.valid_roles;
|
local valid_roles = muc_util.valid_roles;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue