Software /
code /
prosody
Changeset
12975:d10957394a3c
util: Prefix module imports with prosody namespace
line wrap: on
line diff
--- a/util/adminstream.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/adminstream.lua Fri Mar 17 16:23:16 2023 +0100 @@ -1,15 +1,15 @@ -local st = require "util.stanza"; -local new_xmpp_stream = require "util.xmppstream".new; -local sessionlib = require "util.session"; -local gettime = require "util.time".now; -local runner = require "util.async".runner; -local add_task = require "util.timer".add_task; -local events = require "util.events"; -local server = require "net.server"; +local st = require "prosody.util.stanza"; +local new_xmpp_stream = require "prosody.util.xmppstream".new; +local sessionlib = require "prosody.util.session"; +local gettime = require "prosody.util.time".now; +local runner = require "prosody.util.async".runner; +local add_task = require "prosody.util.timer".add_task; +local events = require "prosody.util.events"; +local server = require "prosody.net.server"; local stream_close_timeout = 5; -local log = require "util.logger".init("adminstream"); +local log = require "prosody.util.logger".init("adminstream"); local xmlns_xmpp_streams = "urn:ietf:params:xml:ns:xmpp-streams";
--- a/util/array.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/array.lua Fri Mar 17 16:23:16 2023 +0100 @@ -8,7 +8,7 @@ local t_insert, t_sort, t_remove, t_concat = table.insert, table.sort, table.remove, table.concat; -local t_move = require "util.table".move; +local t_move = require "prosody.util.table".move; local setmetatable = setmetatable; local getmetatable = getmetatable;
--- a/util/async.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/async.lua Fri Mar 17 16:23:16 2023 +0100 @@ -1,7 +1,7 @@ -local logger = require "util.logger"; +local logger = require "prosody.util.logger"; local log = logger.init("util.async"); -local new_id = require "util.id".short; -local xpcall = require "util.xpcall".xpcall; +local new_id = require "prosody.util.id".short; +local xpcall = require "prosody.util.xpcall".xpcall; local function checkthread() local thread, main = coroutine.running();
--- a/util/bitcompat.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/bitcompat.lua Fri Mar 17 16:23:16 2023 +0100 @@ -9,7 +9,7 @@ do -- Lua 5.3 and 5.4 would be able to use native infix operators - local ok, bitop = pcall(require, "util.bit53") + local ok, bitop = pcall(require, "prosody.util.bit53") if ok then return bitop; end
--- a/util/caps.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/caps.lua Fri Mar 17 16:23:16 2023 +0100 @@ -6,8 +6,8 @@ -- COPYING file in the source package for more information. -- -local base64 = require "util.encodings".base64.encode; -local sha1 = require "util.hashes".sha1; +local base64 = require "prosody.util.encodings".base64.encode; +local sha1 = require "prosody.util.hashes".sha1; local t_insert, t_sort, t_concat = table.insert, table.sort, table.concat; local ipairs = ipairs;
--- a/util/dataforms.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/dataforms.lua Fri Mar 17 16:23:16 2023 +0100 @@ -12,9 +12,9 @@ local tonumber = tonumber; local tostring = tostring; local t_concat = table.concat; -local st = require "util.stanza"; -local jid_prep = require "util.jid".prep; -local datetime = require "util.datetime"; +local st = require "prosody.util.stanza"; +local jid_prep = require "prosody.util.jid".prep; +local datetime = require "prosody.util.datetime"; local _ENV = nil; -- luacheck: std none
--- a/util/datamanager.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/datamanager.lua Fri Mar 17 16:23:16 2023 +0100 @@ -12,7 +12,7 @@ local ipairs = ipairs; local char = string.char; local pcall = pcall; -local log = require "util.logger".init("datamanager"); +local log = require "prosody.util.logger".init("datamanager"); local io_open = io.open; local os_remove = os.remove; local os_rename = os.rename; @@ -21,8 +21,8 @@ local type = type; local t_insert = table.insert; local t_concat = table.concat; -local envloadfile = require"util.envload".envloadfile; -local serialize = require "util.serialization".serialize; +local envloadfile = require"prosody.util.envload".envloadfile; +local serialize = require "prosody.util.serialization".serialize; local lfs = require "lfs"; -- Extract directory separator from package.config (an undocumented string that comes with lua) local path_separator = assert ( package.config:match ( "^([^\n]+)" ) , "package.config not in standard form" ) @@ -33,7 +33,7 @@ local atomic_append; local ENOENT = 2; pcall(function() - local pposix = require "util.pposix"; + local pposix = require "prosody.util.pposix"; raw_mkdir = pposix.mkdir or raw_mkdir; -- Doesn't trample on umask atomic_append = pposix.atomic_append; ENOENT = pposix.ENOENT or ENOENT;
--- a/util/datamapper.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/datamapper.lua Fri Mar 17 16:23:16 2023 +0100 @@ -1,11 +1,11 @@ -- This file is generated from teal-src/util/datamapper.lua if not math.type then - require("util.mathcompat") + require("prosody.util.mathcompat") end -local st = require("util.stanza"); -local pointer = require("util.jsonpointer"); +local st = require("prosody.util.stanza"); +local pointer = require("prosody.util.jsonpointer"); local schema_t = {}
--- a/util/dbuffer.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/dbuffer.lua Fri Mar 17 16:23:16 2023 +0100 @@ -1,4 +1,4 @@ -local queue = require "util.queue"; +local queue = require "prosody.util.queue"; local s_byte, s_sub = string.byte, string.sub; local dbuffer_methods = {};
--- a/util/debug.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/debug.lua Fri Mar 17 16:23:16 2023 +0100 @@ -12,7 +12,7 @@ }; local optimal_line_length = 65; -local termcolours = require "util.termcolours"; +local termcolours = require "prosody.util.termcolours"; local getstring = termcolours.getstring; local styles; do
--- a/util/dependencies.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/dependencies.lua Fri Mar 17 16:23:16 2023 +0100 @@ -7,7 +7,7 @@ -- local function softreq(...) local ok, lib = pcall(require, ...); if ok then return lib; else return nil, lib; end end -local platform_table = require "util.human.io".table({ { width = 15, align = "right" }, { width = "100%" } }); +local platform_table = require "prosody.util.human.io".table({ { width = 15, align = "right" }, { width = "100%" } }); -- Required to be able to find packages installed with luarocks if not softreq "luarocks.loader" then -- LuaRocks 2.x @@ -88,7 +88,7 @@ }, nil, err); end - local bit, err = softreq"util.bitcompat"; + local bit, err = softreq"prosody.util.bitcompat"; if not bit then missingdep("lua-bitops", { @@ -106,16 +106,16 @@ { "Source", "https://www.zash.se/luaunbound.html" }; }, "Old DNS resolver library will be used", err); else - package.preload["net.adns"] = function () - local ub = require "net.unbound"; + package.preload["prosody.net.adns"] = function () + local ub = require "prosody.net.unbound"; return ub; end end - local encodings, err = softreq "util.encodings" + local encodings, err = softreq "prosody.util.encodings" if not encodings then if err:match("module '[^']*' not found") then - missingdep("util.encodings", { + missingdep("prosody.util.encodings", { { "Windows", "Make sure you have encodings.dll from the Prosody distribution in util/" }; { "GNU/Linux", "Run './configure' and 'make' in the Prosody source directory to build util/encodings.so" }; }); @@ -130,10 +130,10 @@ fatal = true; end - local hashes, err = softreq "util.hashes" + local hashes, err = softreq "prosody.util.hashes" if not hashes then if err:match("module '[^']*' not found") then - missingdep("util.hashes", { + missingdep("prosody.util.hashes", { { "Windows", "Make sure you have hashes.dll from the Prosody distribution in util/" }; { "GNU/Linux", "Run './configure' and 'make' in the Prosody source directory to build util/hashes.so" }; });
--- a/util/dns.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/dns.lua Fri Mar 17 16:23:16 2023 +0100 @@ -12,9 +12,9 @@ local s_format = string.format; local s_sub = string.sub; -local iana_data = require "util.dnsregistry"; -local tohex = require "util.hex".encode; -local inet_ntop = require "util.net".ntop; +local iana_data = require "prosody.util.dnsregistry"; +local tohex = require "prosody.util.hex".encode; +local inet_ntop = require "prosody.util.net".ntop; -- Simplified versions of Waqas DNS parsers -- Only the per RR parsers are needed and only feed a single RR
--- a/util/error.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/error.lua Fri Mar 17 16:23:16 2023 +0100 @@ -1,4 +1,4 @@ -local id = require "util.id"; +local id = require "prosody.util.id"; local util_debug; -- only imported on-demand @@ -19,7 +19,7 @@ if opt.auto_inject_traceback ~= nil then auto_inject_traceback = opt.auto_inject_traceback; if auto_inject_traceback then - util_debug = require "util.debug"; + util_debug = require "prosody.util.debug"; end end end
--- a/util/format.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/format.lua Fri Mar 17 16:23:16 2023 +0100 @@ -8,9 +8,9 @@ local tostring = tostring; local unpack = table.unpack; local pack = table.pack; -local valid_utf8 = require "util.encodings".utf8.valid; +local valid_utf8 = require "prosody.util.encodings".utf8.valid; local type = type; -local dump = require "util.serialization".new("debug"); +local dump = require "prosody.util.serialization".new("debug"); local num_type = math.type; -- In Lua 5.3+ these formats throw an error if given a float
--- a/util/gc.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/gc.lua Fri Mar 17 16:23:16 2023 +0100 @@ -1,4 +1,4 @@ -local set = require "util.set"; +local set = require "prosody.util.set"; local known_options = { incremental = set.new { "mode", "threshold", "speed", "step_size" };
--- a/util/hashring.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/hashring.lua Fri Mar 17 16:23:16 2023 +0100 @@ -1,4 +1,4 @@ -local it = require "util.iterators"; +local it = require "prosody.util.iterators"; local function generate_ring(nodes, num_replicas, hash) local new_ring = {};
--- a/util/helpers.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/helpers.lua Fri Mar 17 16:23:16 2023 +0100 @@ -6,11 +6,11 @@ -- COPYING file in the source package for more information. -- -local debug = require "util.debug"; +local debug = require "prosody.util.debug"; -- Helper functions for debugging -local log = require "util.logger".init("util.debug"); +local log = require "prosody.util.logger".init("util.debug"); local function log_events(events, name, logger) local f = events.fire_event;
--- a/util/hmac.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/hmac.lua Fri Mar 17 16:23:16 2023 +0100 @@ -8,7 +8,7 @@ -- COMPAT: Only for external pre-0.9 modules -local hashes = require "util.hashes" +local hashes = require "prosody.util.hashes" return { md5 = hashes.hmac_md5,
--- a/util/human/io.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/human/io.lua Fri Mar 17 16:23:16 2023 +0100 @@ -1,5 +1,5 @@ -local array = require "util.array"; -local utf8 = rawget(_G, "utf8") or require"util.encodings".utf8; +local array = require "prosody.util.array"; +local utf8 = rawget(_G, "utf8") or require"prosody.util.encodings".utf8; local len = utf8.len or function(s) local _, count = s:gsub("[%z\001-\127\194-\253][\128-\191]*", ""); return count;
--- a/util/id.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/id.lua Fri Mar 17 16:23:16 2023 +0100 @@ -8,8 +8,8 @@ -- local s_gsub = string.gsub; -local random_bytes = require "util.random".bytes; -local base64_encode = require "util.encodings".base64.encode; +local random_bytes = require "prosody.util.random".bytes; +local base64_encode = require "prosody.util.encodings".base64.encode; local b64url = { ["+"] = "-", ["/"] = "_", ["="] = "" }; local function b64url_random(len)
--- a/util/ip.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/ip.lua Fri Mar 17 16:23:16 2023 +0100 @@ -5,8 +5,8 @@ -- COPYING file in the source package for more information. -- -local net = require "util.net"; -local hex = require "util.hex"; +local net = require "prosody.util.net"; +local hex = require "prosody.util.hex"; local ip_methods = {};
--- a/util/jid.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/jid.lua Fri Mar 17 16:23:16 2023 +0100 @@ -10,9 +10,9 @@ local select = select; local match, sub = string.match, string.sub; -local nodeprep = require "util.encodings".stringprep.nodeprep; -local nameprep = require "util.encodings".stringprep.nameprep; -local resourceprep = require "util.encodings".stringprep.resourceprep; +local nodeprep = require "prosody.util.encodings".stringprep.nodeprep; +local nameprep = require "prosody.util.encodings".stringprep.nameprep; +local resourceprep = require "prosody.util.encodings".stringprep.resourceprep; local escapes = { [" "] = "\\20"; ['"'] = "\\22";
--- a/util/json.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/json.lua Fri Mar 17 16:23:16 2023 +0100 @@ -10,12 +10,12 @@ local t_insert, t_concat, t_remove = table.insert, table.concat, table.remove; local s_char = string.char; local tostring, tonumber = tostring, tonumber; -local pairs, ipairs, spairs = pairs, ipairs, require "util.iterators".sorted_pairs; +local pairs, ipairs, spairs = pairs, ipairs, require "prosody.util.iterators".sorted_pairs; local next = next; local getmetatable, setmetatable = getmetatable, setmetatable; local print = print; -local has_array, array = pcall(require, "util.array"); +local has_array, array = pcall(require, "prosody.util.array"); local array_mt = has_array and getmetatable(array()) or {}; --module("json")
--- a/util/jsonschema.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/jsonschema.lua Fri Mar 17 16:23:16 2023 +0100 @@ -3,10 +3,10 @@ local m_type = function(n) return type(n) == "number" and n % 1 == 0 and n <= 9007199254740992 and n >= -9007199254740992 and "integer" or "float"; end; -local json = require("util.json") +local json = require("prosody.util.json") local null = json.null; -local pointer = require("util.jsonpointer") +local pointer = require("prosody.util.jsonpointer") local json_type_name = json.json_type_name
--- a/util/jwt.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/jwt.lua Fri Mar 17 16:23:16 2023 +0100 @@ -1,10 +1,10 @@ local s_gsub = string.gsub; -local crypto = require "util.crypto"; -local json = require "util.json"; -local hashes = require "util.hashes"; -local base64_encode = require "util.encodings".base64.encode; -local base64_decode = require "util.encodings".base64.decode; -local secure_equals = require "util.hashes".equals; +local crypto = require "prosody.util.crypto"; +local json = require "prosody.util.json"; +local hashes = require "prosody.util.hashes"; +local base64_encode = require "prosody.util.encodings".base64.encode; +local base64_decode = require "prosody.util.encodings".base64.decode; +local secure_equals = require "prosody.util.hashes".equals; local b64url_rep = { ["+"] = "-", ["/"] = "_", ["="] = "", ["-"] = "+", ["_"] = "/" }; local function b64url(data)
--- a/util/logger.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/logger.lua Fri Mar 17 16:23:16 2023 +0100 @@ -72,7 +72,7 @@ end local function add_simple_sink(simple_sink_function, levels) - local format = require "util.format".format; + local format = require "prosody.util.format".format; local function sink_function(name, level, msg, ...) return simple_sink_function(name, level, format(msg, ...)); end
--- a/util/openmetrics.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/openmetrics.lua Fri Mar 17 16:23:16 2023 +0100 @@ -19,12 +19,12 @@ -- metric constructor interface: -- metric_ctor(..., family_name, labels, extra) -local time = require "util.time".now; +local time = require "prosody.util.time".now; local select = select; -local array = require "util.array"; -local log = require "util.logger".init("util.openmetrics"); -local new_multitable = require "util.multitable".new; -local iter_multitable = require "util.multitable".iter; +local array = require "prosody.util.array"; +local log = require "prosody.util.logger".init("util.openmetrics"); +local new_multitable = require "prosody.util.multitable".new; +local iter_multitable = require "prosody.util.multitable".iter; local t_concat, t_insert = table.concat, table.insert; local t_pack, t_unpack = table.pack, table.unpack;
--- a/util/openssl.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/openssl.lua Fri Mar 17 16:23:16 2023 +0100 @@ -5,7 +5,7 @@ local oid_xmppaddr = "1.3.6.1.5.5.7.8.5"; -- [XMPP-CORE] local oid_dnssrv = "1.3.6.1.5.5.7.8.7"; -- [SRV-ID] -local idna_to_ascii = require "util.encodings".idna.to_ascii; +local idna_to_ascii = require "prosody.util.encodings".idna.to_ascii; local _M = {}; local config = {};
--- a/util/paseto.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/paseto.lua Fri Mar 17 16:23:16 2023 +0100 @@ -1,13 +1,13 @@ -local crypto = require "util.crypto"; -local json = require "util.json"; -local hashes = require "util.hashes"; -local base64_encode = require "util.encodings".base64.encode; -local base64_decode = require "util.encodings".base64.decode; -local secure_equals = require "util.hashes".equals; -local bit = require "util.bitcompat"; -local hex = require "util.hex"; -local rand = require "util.random"; -local s_pack = require "util.struct".pack; +local crypto = require "prosody.util.crypto"; +local json = require "prosody.util.json"; +local hashes = require "prosody.util.hashes"; +local base64_encode = require "prosody.util.encodings".base64.encode; +local base64_decode = require "prosody.util.encodings".base64.decode; +local secure_equals = require "prosody.util.hashes".equals; +local bit = require "prosody.util.bitcompat"; +local hex = require "prosody.util.hex"; +local rand = require "prosody.util.random"; +local s_pack = require "prosody.util.struct".pack; local s_gsub = string.gsub;
--- a/util/pluginloader.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/pluginloader.lua Fri Mar 17 16:23:16 2023 +0100 @@ -17,7 +17,7 @@ end local io_open = io.open; -local envload = require "util.envload".envload; +local envload = require "prosody.util.envload".envload; local pluginloader_methods = {}; local pluginloader_mt = { __index = pluginloader_methods };
--- a/util/promise.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/promise.lua Fri Mar 17 16:23:16 2023 +0100 @@ -1,7 +1,7 @@ local promise_methods = {}; local promise_mt = { __name = "promise", __index = promise_methods }; -local xpcall = require "util.xpcall".xpcall; +local xpcall = require "prosody.util.xpcall".xpcall; local unpack = table.unpack; function promise_mt:__tostring()
--- a/util/prosodyctl.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/prosodyctl.lua Fri Mar 17 16:23:16 2023 +0100 @@ -7,14 +7,14 @@ -- -local config = require "core.configmanager"; -local encodings = require "util.encodings"; +local config = require "prosody.core.configmanager"; +local encodings = require "prosody.util.encodings"; local stringprep = encodings.stringprep; -local storagemanager = require "core.storagemanager"; -local usermanager = require "core.usermanager"; -local interpolation = require "util.interpolation"; -local signal = require "util.signal"; -local set = require "util.set"; +local storagemanager = require "prosody.core.storagemanager"; +local usermanager = require "prosody.core.usermanager"; +local interpolation = require "prosody.util.interpolation"; +local signal = require "prosody.util.signal"; +local set = require "prosody.util.set"; local lfs = require "lfs"; local type = type; @@ -42,7 +42,7 @@ }, { __index = function (_,k) return "Error: "..(tostring(k):gsub("%-", " "):gsub("^.", string.upper)); end }); -- UI helpers -local show_message = require "util.human.io".printf; +local show_message = require "prosody.util.human.io".printf; local function show_usage(usage, desc) print("Usage: ".._G.arg[0].." "..usage);
--- a/util/prosodyctl/cert.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/prosodyctl/cert.lua Fri Mar 17 16:23:16 2023 +0100 @@ -1,8 +1,8 @@ local lfs = require "lfs"; -local pctl = require "util.prosodyctl"; -local hi = require "util.human.io"; -local configmanager = require "core.configmanager"; +local pctl = require "prosody.util.prosodyctl"; +local hi = require "prosody.util.human.io"; +local configmanager = require "prosody.core.configmanager"; local openssl; @@ -24,7 +24,7 @@ end end -local have_pposix, pposix = pcall(require, "util.pposix"); +local have_pposix, pposix = pcall(require, "prosody.util.pposix"); local cert_basedir = prosody.paths.data == "." and "./certs" or prosody.paths.data; if have_pposix and pposix.getuid() == 0 then -- FIXME should be enough to check if this directory is writable @@ -219,7 +219,7 @@ owner = configmanager.get("*", "prosody_user") or "prosody"; group = configmanager.get("*", "prosody_group") or owner; end - local cm = require "core.certmanager"; + local cm = require "prosody.core.certmanager"; local files_by_name = {} for _, dir in ipairs(arg) do cm.index_certs(dir, files_by_name); @@ -271,7 +271,7 @@ local function cert(arg) if #arg >= 1 and arg[1] ~= "--help" then - openssl = require "util.openssl"; + openssl = require "prosody.util.openssl"; lfs = require "lfs"; local cert_dir_attrs = lfs.attributes(cert_basedir); if not cert_dir_attrs then @@ -303,7 +303,7 @@ end return cert_commands[subcmd](arg); elseif subcmd == "check" then - return require "util.prosodyctl.check".check({"certs"}); + return require "prosody.util.prosodyctl.check".check({"certs"}); end end pctl.show_usage("cert config|request|generate|key|import", "Helpers for generating X.509 certificates and keys.")
--- a/util/prosodyctl/check.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/prosodyctl/check.lua Fri Mar 17 16:23:16 2023 +0100 @@ -1,19 +1,19 @@ -local configmanager = require "core.configmanager"; -local show_usage = require "util.prosodyctl".show_usage; -local show_warning = require "util.prosodyctl".show_warning; -local is_prosody_running = require "util.prosodyctl".isrunning; -local parse_args = require "util.argparse".parse; -local dependencies = require "util.dependencies"; +local configmanager = require "prosody.core.configmanager"; +local show_usage = require "prosody.util.prosodyctl".show_usage; +local show_warning = require "prosody.util.prosodyctl".show_warning; +local is_prosody_running = require "prosody.util.prosodyctl".isrunning; +local parse_args = require "prosody.util.argparse".parse; +local dependencies = require "prosody.util.dependencies"; local socket = require "socket"; local socket_url = require "socket.url"; -local jid_split = require "util.jid".prepped_split; -local modulemanager = require "core.modulemanager"; -local async = require "util.async"; -local httputil = require "util.http"; +local jid_split = require "prosody.util.jid".prepped_split; +local modulemanager = require "prosody.core.modulemanager"; +local async = require "prosody.util.async"; +local httputil = require "prosody.util.http"; local function check_ojn(check_type, target_host) - local http = require "net.http"; -- .new({}); - local json = require "util.json"; + local http = require "prosody.net.http"; -- .new({}); + local json = require "prosody.util.json"; local response, err = async.wait_for(http.request( ("https://observe.jabber.network/api/v1/check/%s"):format(httputil.urlencode(check_type)), @@ -41,7 +41,7 @@ end local function check_probe(base_url, probe_module, target) - local http = require "net.http"; -- .new({}); + local http = require "prosody.net.http"; -- .new({}); local params = httputil.formencode({ module = probe_module; target = target }) local response, err = async.wait_for(http.request(base_url .. "?" .. params)); @@ -62,8 +62,8 @@ end local function check_turn_service(turn_service, ping_service) - local ip = require "util.ip"; - local stun = require "net.stun"; + local ip = require "prosody.util.ip"; + local stun = require "prosody.net.stun"; -- Create UDP socket for communication with the server local sock = assert(require "socket".udp()); @@ -304,9 +304,9 @@ print("Error: Unknown parameter: "..opts_info); return 1; end - local array = require "util.array"; - local set = require "util.set"; - local it = require "util.iterators"; + local array = require "prosody.util.array"; + local set = require "prosody.util.set"; + local it = require "prosody.util.iterators"; local ok = true; local function disabled_hosts(host, conf) return host ~= "*" and conf.enabled ~= false; end local function enabled_hosts() return it.filter(disabled_hosts, pairs(configmanager.getconfig())); end @@ -706,13 +706,13 @@ print("Done.\n"); end if not what or what == "dns" then - local dns = require "net.dns"; + local dns = require "prosody.net.dns"; pcall(function () - local unbound = require"net.unbound"; + local unbound = require"prosody.net.unbound"; dns = unbound.dns; end) - local idna = require "util.encodings".idna; - local ip = require "util.ip"; + local idna = require "prosody.util.encodings".idna; + local ip = require "prosody.util.ip"; local c2s_ports = set.new(configmanager.get("*", "c2s_ports") or {5222}); local s2s_ports = set.new(configmanager.get("*", "s2s_ports") or {5269}); local c2s_tls_ports = set.new(configmanager.get("*", "c2s_direct_tls_ports") or {}); @@ -769,7 +769,7 @@ end end - local local_addresses = require"util.net".local_addresses() or {}; + local local_addresses = require"prosody.util.net".local_addresses() or {}; for addr in it.values(local_addresses) do if not ip.new_ip(addr).private then @@ -1072,8 +1072,8 @@ if not what or what == "certs" then local cert_ok; print"Checking certificates..." - local x509_verify_identity = require"util.x509".verify_identity; - local create_context = require "core.certmanager".create_context; + local x509_verify_identity = require"prosody.util.x509".verify_identity; + local create_context = require "prosody.core.certmanager".create_context; local ssl = dependencies.softreq"ssl"; -- local datetime_parse = require"util.datetime".parse_x509; local load_cert = ssl and ssl.loadcertificate;
--- a/util/prosodyctl/shell.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/prosodyctl/shell.lua Fri Mar 17 16:23:16 2023 +0100 @@ -1,15 +1,15 @@ -local config = require "core.configmanager"; -local server = require "net.server"; -local st = require "util.stanza"; -local path = require "util.paths"; -local parse_args = require "util.argparse".parse; +local config = require "prosody.core.configmanager"; +local server = require "prosody.net.server"; +local st = require "prosody.util.stanza"; +local path = require "prosody.util.paths"; +local parse_args = require "prosody.util.argparse".parse; local unpack = table.unpack or _G.unpack; -local tc = require "util.termcolours"; -local isatty = require "util.pposix".isatty; +local tc = require "prosody.util.termcolours"; +local isatty = require "prosody.util.pposix".isatty; local have_readline, readline = pcall(require, "readline"); -local adminstream = require "util.adminstream"; +local adminstream = require "prosody.util.adminstream"; if have_readline then readline.set_readline_name("prosody");
--- a/util/pubsub.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/pubsub.lua Fri Mar 17 16:23:16 2023 +0100 @@ -1,6 +1,6 @@ -local events = require "util.events"; -local cache = require "util.cache"; -local errors = require "util.error"; +local events = require "prosody.util.events"; +local cache = require "prosody.util.cache"; +local errors = require "prosody.util.error"; local service_mt = {};
--- a/util/queue.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/queue.lua Fri Mar 17 16:23:16 2023 +0100 @@ -9,7 +9,7 @@ -- Small ringbuffer library (i.e. an efficient FIFO queue with a size limit) -- (because unbounded dynamically-growing queues are a bad thing...) -local have_utable, utable = pcall(require, "util.table"); -- For pre-allocation of table +local have_utable, utable = pcall(require, "prosody.util.table"); -- For pre-allocation of table local function new(size, allow_wrapping) -- Head is next insert, tail is next read
--- a/util/random.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/random.lua Fri Mar 17 16:23:16 2023 +0100 @@ -6,7 +6,7 @@ -- COPYING file in the source package for more information. -- -local ok, crand = pcall(require, "util.crand"); +local ok, crand = pcall(require, "prosody.util.crand"); if ok and pcall(crand.bytes, 1) then return crand; end local urandom, urandom_err = io.open("/dev/urandom", "r");
--- a/util/rfc6724.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/rfc6724.lua Fri Mar 17 16:23:16 2023 +0100 @@ -9,7 +9,7 @@ -- during S2S connections. -- We can't hand this off to getaddrinfo, since it blocks -local ip_commonPrefixLength = require"util.ip".commonPrefixLength +local ip_commonPrefixLength = require"prosody.util.ip".commonPrefixLength local function commonPrefixLength(ipA, ipB) local len = ip_commonPrefixLength(ipA, ipB);
--- a/util/roles.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/roles.lua Fri Mar 17 16:23:16 2023 +0100 @@ -1,6 +1,6 @@ -local array = require "util.array"; -local it = require "util.iterators"; -local new_short_id = require "util.id".short; +local array = require "prosody.util.array"; +local it = require "prosody.util.iterators"; +local new_short_id = require "prosody.util.id".short; local role_methods = {}; local role_mt = {
--- a/util/rsm.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/rsm.lua Fri Mar 17 16:23:16 2023 +0100 @@ -9,7 +9,7 @@ -- XEP-0313: Message Archive Management for Prosody -- -local stanza = require"util.stanza".stanza; +local stanza = require"prosody.util.stanza".stanza; local tonumber = tonumber; local s_format = string.format; local type = type;
--- a/util/sasl.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/sasl.lua Fri Mar 17 16:23:16 2023 +0100 @@ -133,11 +133,11 @@ end -- load the mechanisms -require "util.sasl.plain" .init(registerMechanism); -require "util.sasl.anonymous" .init(registerMechanism); -require "util.sasl.oauthbearer" .init(registerMechanism); -require "util.sasl.scram" .init(registerMechanism); -require "util.sasl.external" .init(registerMechanism); +require "prosody.util.sasl.plain" .init(registerMechanism); +require "prosody.util.sasl.anonymous" .init(registerMechanism); +require "prosody.util.sasl.oauthbearer" .init(registerMechanism); +require "prosody.util.sasl.scram" .init(registerMechanism); +require "prosody.util.sasl.external" .init(registerMechanism); return { registerMechanism = registerMechanism;
--- a/util/sasl/anonymous.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/sasl/anonymous.lua Fri Mar 17 16:23:16 2023 +0100 @@ -12,7 +12,7 @@ -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -local generate_random_id = require "util.id".medium; +local generate_random_id = require "prosody.util.id".medium; local _ENV = nil; -- luacheck: std none
--- a/util/sasl/external.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/sasl/external.lua Fri Mar 17 16:23:16 2023 +0100 @@ -1,4 +1,4 @@ -local saslprep = require "util.encodings".stringprep.saslprep; +local saslprep = require "prosody.util.encodings".stringprep.saslprep; local _ENV = nil; -- luacheck: std none
--- a/util/sasl/oauthbearer.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/sasl/oauthbearer.lua Fri Mar 17 16:23:16 2023 +0100 @@ -1,4 +1,4 @@ -local json = require "util.json"; +local json = require "prosody.util.json"; local _ENV = nil;
--- a/util/sasl/plain.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/sasl/plain.lua Fri Mar 17 16:23:16 2023 +0100 @@ -12,9 +12,9 @@ -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. local s_match = string.match; -local saslprep = require "util.encodings".stringprep.saslprep; -local nodeprep = require "util.encodings".stringprep.nodeprep; -local log = require "util.logger".init("sasl"); +local saslprep = require "prosody.util.encodings".stringprep.saslprep; +local nodeprep = require "prosody.util.encodings".stringprep.nodeprep; +local log = require "prosody.util.logger".init("sasl"); local _ENV = nil; -- luacheck: std none
--- a/util/sasl/scram.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/sasl/scram.lua Fri Mar 17 16:23:16 2023 +0100 @@ -13,13 +13,13 @@ local s_match = string.match; local type = type -local base64 = require "util.encodings".base64; -local hashes = require "util.hashes"; -local generate_uuid = require "util.uuid".generate; -local saslprep = require "util.encodings".stringprep.saslprep; -local nodeprep = require "util.encodings".stringprep.nodeprep; -local log = require "util.logger".init("sasl"); -local binaryXOR = require "util.strbitop".sxor; +local base64 = require "prosody.util.encodings".base64; +local hashes = require "prosody.util.hashes"; +local generate_uuid = require "prosody.util.uuid".generate; +local saslprep = require "prosody.util.encodings".stringprep.saslprep; +local nodeprep = require "prosody.util.encodings".stringprep.nodeprep; +local log = require "prosody.util.logger".init("sasl"); +local binaryXOR = require "prosody.util.strbitop".sxor; local _ENV = nil; -- luacheck: std none
--- a/util/serialization.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/serialization.lua Fri Mar 17 16:23:16 2023 +0100 @@ -16,13 +16,13 @@ local s_match = string.match; local t_concat = table.concat; -local to_hex = require "util.hex".to; +local to_hex = require "prosody.util.hex".to; local pcall = pcall; -local envload = require"util.envload".envload; +local envload = require"prosody.util.envload".envload; if not math.type then - require "util.mathcompat" + require "prosody.util.mathcompat" end local pos_inf, neg_inf = math.huge, -math.huge;
--- a/util/session.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/session.lua Fri Mar 17 16:23:16 2023 +0100 @@ -1,5 +1,5 @@ -local initialize_filters = require "util.filters".initialize; -local logger = require "util.logger"; +local initialize_filters = require "prosody.util.filters".initialize; +local logger = require "prosody.util.logger"; local function new_session(typ) local session = {
--- a/util/smqueue.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/smqueue.lua Fri Mar 17 16:23:16 2023 +0100 @@ -1,4 +1,4 @@ -local queue = require("util.queue"); +local queue = require("prosody.util.queue"); local lib = { smqueue = {} }
--- a/util/sql.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/sql.lua Fri Mar 17 16:23:16 2023 +0100 @@ -4,9 +4,9 @@ local tostring = tostring; local type = type; local assert, pcall, debug_traceback = assert, pcall, debug.traceback; -local xpcall = require "util.xpcall".xpcall; +local xpcall = require "prosody.util.xpcall".xpcall; local t_concat = table.concat; -local log = require "util.logger".init("sql"); +local log = require "prosody.util.logger".init("sql"); local DBI = require "DBI"; -- This loads all available drivers while globals are unlocked
--- a/util/sqlite3.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/sqlite3.lua Fri Mar 17 16:23:16 2023 +0100 @@ -9,14 +9,14 @@ local t_concat = table.concat; local t_insert = table.insert; local s_char = string.char; -local log = require "util.logger".init("sql"); +local log = require "prosody.util.logger".init("sql"); local lsqlite3 = require "lsqlite3"; local build_url = require "socket.url".build; local ROW, DONE = lsqlite3.ROW, lsqlite3.DONE; -- from sqlite3.h, no copyright claimed -local sqlite_errors = require"util.error".init("util.sqlite3", { +local sqlite_errors = require"prosody.util.error".init("util.sqlite3", { -- FIXME xmpp error conditions? [1] = { code = 1; type = "modify"; condition = "ERROR"; text = "Generic error" }; [2] = { code = 2; type = "cancel"; condition = "INTERNAL"; text = "Internal logic error in SQLite" };
--- a/util/sslconfig.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/sslconfig.lua Fri Mar 17 16:23:16 2023 +0100 @@ -8,7 +8,7 @@ local t_concat = table.concat; local t_insert = table.insert; local setmetatable = setmetatable; -local resolve_path = require"util.paths".resolve_relative_path; +local resolve_path = require"prosody.util.paths".resolve_relative_path; local _ENV = nil; -- luacheck: std none
--- a/util/stanza.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/stanza.lua Fri Mar 17 16:23:16 2023 +0100 @@ -21,12 +21,12 @@ local s_gsub = string.gsub; local s_sub = string.sub; local s_find = string.find; -local t_move = table.move or require "util.table".move; -local t_create = require"util.table".create; +local t_move = table.move or require "prosody.util.table".move; +local t_create = require"prosody.util.table".create; -local valid_utf8 = require "util.encodings".utf8.valid; +local valid_utf8 = require "prosody.util.encodings".utf8.valid; -local do_pretty_printing, termcolours = pcall(require, "util.termcolours"); +local do_pretty_printing, termcolours = pcall(require, "prosody.util.termcolours"); local xmlns_stanzas = "urn:ietf:params:xml:ns:xmpp-stanzas"; local xmpp_stanzas_attr = { xmlns = xmlns_stanzas };
--- a/util/startup.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/startup.lua Fri Mar 17 16:23:16 2023 +0100 @@ -2,15 +2,15 @@ -- luacheck: ignore 113/CFG_CONFIGDIR 113/CFG_SOURCEDIR 113/CFG_DATADIR 113/CFG_PLUGINDIR local startup = {}; -local prosody = { events = require "util.events".new() }; -local logger = require "util.logger"; +local prosody = { events = require "prosody.util.events".new() }; +local logger = require "prosody.util.logger"; local log = logger.init("startup"); -local parse_args = require "util.argparse".parse; +local parse_args = require "prosody.util.argparse".parse; -local config = require "core.configmanager"; +local config = require "prosody.core.configmanager"; local config_warnings; -local dependencies = require "util.dependencies"; +local dependencies = require "prosody.util.dependencies"; local original_logging_config; @@ -132,14 +132,14 @@ function startup.load_libraries() -- Load socket framework -- luacheck: ignore 111/server 111/socket - require "util.import" + require "prosody.util.import" socket = require "socket"; - server = require "net.server" + server = require "prosody.net.server" end function startup.init_logging() -- Initialize logging - local loggingmanager = require "core.loggingmanager" + local loggingmanager = require "prosody.core.loggingmanager" loggingmanager.reload_logging(); prosody.events.add_handler("config-reloaded", function () prosody.events.fire_event("reopen-log-files"); @@ -280,7 +280,7 @@ -- COMPAT Lua < 5.3 if not math.type then - require "util.mathcompat" + require "prosody.util.mathcompat" end end @@ -303,7 +303,7 @@ local installer_plugin_path = config.get("*", "installer_plugin_path") or "custom_plugins"; local path_sep = package.config:sub(3,3); installer_plugin_path = config.resolve_relative_path(CFG_DATADIR or "data", installer_plugin_path); - require"util.paths".complement_lua_path(installer_plugin_path); + require"prosody.util.paths".complement_lua_path(installer_plugin_path); -- luacheck: ignore 111 CFG_PLUGINDIR = installer_plugin_path..path_sep..(CFG_PLUGINDIR or "plugins"); prosody.paths.installer = installer_plugin_path; @@ -365,28 +365,28 @@ function startup.load_secondary_libraries() --- Load and initialise core modules - require "util.xmppstream" - require "core.stanza_router" - require "core.statsmanager" - require "core.hostmanager" - require "core.portmanager" - require "core.modulemanager" - require "core.usermanager" - require "core.rostermanager" - require "core.sessionmanager" + require "prosody.util.xmppstream" + require "prosody.core.stanza_router" + require "prosody.core.statsmanager" + require "prosody.core.hostmanager" + require "prosody.core.portmanager" + require "prosody.core.modulemanager" + require "prosody.core.usermanager" + require "prosody.core.rostermanager" + require "prosody.core.sessionmanager" package.loaded['core.componentmanager'] = setmetatable({},{__index=function() -- COMPAT which version? log("warn", "componentmanager is deprecated: %s", debug.traceback():match("\n[^\n]*\n[ \t]*([^\n]*)")); return function() end end}); - require "util.array" - require "util.datetime" - require "util.iterators" - require "util.timer" - require "util.helpers" + require "prosody.util.array" + require "prosody.util.datetime" + require "prosody.util.iterators" + require "prosody.util.timer" + require "prosody.util.helpers" - pcall(require, "util.signal") -- Not on Windows + pcall(require, "prosody.util.signal") -- Not on Windows -- Commented to protect us from -- the second kind of people @@ -395,36 +395,36 @@ if remdebug then remdebug.engine.start() end ]] - require "util.stanza" - require "util.jid" + require "prosody.util.stanza" + require "prosody.util.jid" end function startup.init_http_client() - local http = require "net.http" + local http = require "prosody.net.http" local config_ssl = config.get("*", "ssl") or {} local https_client = config.get("*", "client_https_ssl") - http.default.options.sslctx = require "core.certmanager".create_context("client_https port 0", "client", + http.default.options.sslctx = require "prosody.core.certmanager".create_context("client_https port 0", "client", { capath = config_ssl.capath, cafile = config_ssl.cafile, verify = "peer", }, https_client); http.default.options.use_dane = config.get("*", "use_dane") end function startup.init_promise() - local promise = require "util.promise"; + local promise = require "prosody.util.promise"; - local timer = require "util.timer"; + local timer = require "prosody.util.timer"; promise.set_nexttick(function(f) return timer.add_task(0, f); end); end function startup.init_async() - local async = require "util.async"; + local async = require "prosody.util.async"; - local timer = require "util.timer"; + local timer = require "prosody.util.timer"; async.set_nexttick(function(f) return timer.add_task(0, f); end); async.set_schedule_function(timer.add_task); end function startup.init_data_store() - require "core.storagemanager"; + require "prosody.core.storagemanager"; end function startup.prepare_to_start() @@ -465,7 +465,7 @@ prosody.version = "hg:"..prosody.version; end else - local hg = require"util.mercurial"; + local hg = require"prosody.util.mercurial"; local hgid = hg.check_id(CFG_SOURCEDIR or "."); if hgid then prosody.version = "hg:" .. hgid; end end @@ -503,7 +503,7 @@ -- it is already started as the appropriate user. local want_pposix_version = "0.4.0"; - local have_pposix, pposix = pcall(require, "util.pposix"); + local have_pposix, pposix = pcall(require, "prosody.util.pposix"); if have_pposix and pposix then if pposix._VERSION ~= want_pposix_version then @@ -599,7 +599,7 @@ function startup.init_gc() -- Apply garbage collector settings from the config file - local gc = require "util.gc"; + local gc = require "prosody.util.gc"; local gc_settings = config.get("*", "gc") or { mode = default_gc_params.mode }; local ok, err = gc.configure(gc_settings, default_gc_params); @@ -611,7 +611,7 @@ end function startup.init_errors() - require "util.error".configure(config.get("*", "error_library") or {}); + require "prosody.util.error".configure(config.get("*", "error_library") or {}); end function startup.make_host(hostname) @@ -620,7 +620,7 @@ events = prosody.events, modules = {}, sessions = {}, - users = require "core.usermanager".new_null_provider(hostname) + users = require "prosody.core.usermanager".new_null_provider(hostname) }; end
--- a/util/statistics.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/statistics.lua Fri Mar 17 16:23:16 2023 +0100 @@ -1,6 +1,6 @@ -local time = require "util.time".now; -local new_metric_registry = require "util.openmetrics".new_metric_registry; -local render_histogram_le = require "util.openmetrics".render_histogram_le; +local time = require "prosody.util.time".now; +local new_metric_registry = require "prosody.util.openmetrics".new_metric_registry; +local render_histogram_le = require "prosody.util.openmetrics".render_histogram_le; -- BEGIN of Metric implementations
--- a/util/statsd.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/statsd.lua Fri Mar 17 16:23:16 2023 +0100 @@ -1,10 +1,10 @@ local socket = require "socket"; -local time = require "util.time".now; -local array = require "util.array"; +local time = require "prosody.util.time".now; +local array = require "prosody.util.array"; local t_concat = table.concat; -local new_metric_registry = require "util.openmetrics".new_metric_registry; -local render_histogram_le = require "util.openmetrics".render_histogram_le; +local new_metric_registry = require "prosody.util.openmetrics".new_metric_registry; +local render_histogram_le = require "prosody.util.openmetrics".render_histogram_le; -- BEGIN of Metric implementations
--- a/util/template.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/template.lua Fri Mar 17 16:23:16 2023 +0100 @@ -1,13 +1,13 @@ -- luacheck: ignore 213/i -local stanza_mt = require "util.stanza".stanza_mt; +local stanza_mt = require "prosody.util.stanza".stanza_mt; local setmetatable = setmetatable; local pairs = pairs; local ipairs = ipairs; local error = error; -local envload = require "util.envload".envload; +local envload = require "prosody.util.envload".envload; local debug = debug; local t_remove = table.remove; -local parse_xml = require "util.xml".parse; +local parse_xml = require "prosody.util.xml".parse; local _ENV = nil; -- luacheck: std none
--- a/util/termcolours.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/termcolours.lua Fri Mar 17 16:23:16 2023 +0100 @@ -21,7 +21,7 @@ local windows; if os.getenv("WINDIR") then - windows = require "util.windows"; + windows = require "prosody.util.windows"; end local orig_color = windows and windows.get_consolecolor and windows.get_consolecolor();
--- a/util/throttle.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/throttle.lua Fri Mar 17 16:23:16 2023 +0100 @@ -1,5 +1,5 @@ -local gettime = require "util.time".now +local gettime = require "prosody.util.time".now local setmetatable = setmetatable; local _ENV = nil;
--- a/util/timer.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/timer.lua Fri Mar 17 16:23:16 2023 +0100 @@ -6,14 +6,14 @@ -- COPYING file in the source package for more information. -- -local indexedbheap = require "util.indexedbheap"; -local log = require "util.logger".init("timer"); -local server = require "net.server"; -local get_time = require "util.time".now +local indexedbheap = require "prosody.util.indexedbheap"; +local log = require "prosody.util.logger".init("timer"); +local server = require "prosody.net.server"; +local get_time = require "prosody.util.time".now local type = type; local debug_traceback = debug.traceback; local tostring = tostring; -local xpcall = require "util.xpcall".xpcall; +local xpcall = require "prosody.util.xpcall".xpcall; local math_max = math.max; local pairs = pairs;
--- a/util/uuid.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/uuid.lua Fri Mar 17 16:23:16 2023 +0100 @@ -6,9 +6,9 @@ -- COPYING file in the source package for more information. -- -local random = require "util.random"; +local random = require "prosody.util.random"; local random_bytes = random.bytes; -local hex = require "util.hex".encode; +local hex = require "prosody.util.hex".encode; local m_ceil = math.ceil; local function get_nibbles(n)
--- a/util/watchdog.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/watchdog.lua Fri Mar 17 16:23:16 2023 +0100 @@ -1,4 +1,4 @@ -local timer = require "util.timer"; +local timer = require "prosody.util.timer"; local setmetatable = setmetatable; local _ENV = nil;
--- a/util/x509.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/x509.lua Fri Mar 17 16:23:16 2023 +0100 @@ -18,12 +18,12 @@ -- [LDAP] - https://www.rfc-editor.org/rfc/rfc4519.html -- [PKIX] - https://www.rfc-editor.org/rfc/rfc5280.html -local nameprep = require "util.encodings".stringprep.nameprep; -local idna_to_ascii = require "util.encodings".idna.to_ascii; -local idna_to_unicode = require "util.encodings".idna.to_unicode; -local base64 = require "util.encodings".base64; -local log = require "util.logger".init("x509"); -local mt = require "util.multitable"; +local nameprep = require "prosody.util.encodings".stringprep.nameprep; +local idna_to_ascii = require "prosody.util.encodings".idna.to_ascii; +local idna_to_unicode = require "prosody.util.encodings".idna.to_unicode; +local base64 = require "prosody.util.encodings".base64; +local log = require "prosody.util.logger".init("x509"); +local mt = require "prosody.util.multitable"; local s_format = string.format; local ipairs = ipairs;
--- a/util/xml.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/xml.lua Fri Mar 17 16:23:16 2023 +0100 @@ -1,5 +1,5 @@ -local st = require "util.stanza"; +local st = require "prosody.util.stanza"; local lxp = require "lxp"; local t_insert = table.insert; local t_remove = table.remove;
--- a/util/xmppstream.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/xmppstream.lua Fri Mar 17 16:23:16 2023 +0100 @@ -7,7 +7,7 @@ -- local lxp = require "lxp"; -local st = require "util.stanza"; +local st = require "prosody.util.stanza"; local stanza_mt = st.stanza_mt; local error = error;
--- a/util/xpcall.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/xpcall.lua Fri Mar 17 16:23:16 2023 +0100 @@ -1,7 +1,7 @@ local xpcall = xpcall; if select(2, xpcall(function (x) return x end, function () end, "test")) ~= "test" then - xpcall = require"util.compat".xpcall; + xpcall = require"prosody.util.compat".xpcall; end return {
--- a/util/xtemplate.lua Fri Mar 17 16:23:12 2023 +0100 +++ b/util/xtemplate.lua Fri Mar 17 16:23:16 2023 +0100 @@ -3,7 +3,7 @@ local s_sub = string.sub; local t_concat = table.concat; -local st = require("util.stanza"); +local st = require("prosody.util.stanza"); local function render(template, root, escape, filters) escape = escape or st.xml_escape;