Software /
code /
verse
Changeset
490:6b2f31da9610
Update for new Prosody module namespace
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 20 May 2023 20:48:03 +0200 |
parents | 489:39ed19f12dca |
children | 491:edf078a58f25 |
files | bosh.lua client.lua component.lua init.lua libs/adhoc.lib.lua plugins/adhoc.lua plugins/archive.lua plugins/bind.lua plugins/carbons.lua plugins/disco.lua plugins/groupchat.lua plugins/jingle.lua plugins/jingle_ibb.lua plugins/jingle_s5b.lua plugins/legacy.lua plugins/ping.lua plugins/presence.lua plugins/proxy65.lua plugins/pubsub.lua plugins/roster.lua plugins/sasl.lua plugins/time.lua plugins/vcard.lua plugins/vcard_update.lua squishy util/dataforms.lua util/rsm.lua util/sasl/scram.lua util/sha1.lua util/vcard.lua |
diffstat | 30 files changed, 59 insertions(+), 59 deletions(-) [+] |
line wrap: on
line diff
--- a/bosh.lua Tue May 23 19:46:52 2023 +0200 +++ b/bosh.lua Sat May 20 20:48:03 2023 +0200 @@ -1,8 +1,7 @@ -local new_xmpp_stream = require "util.xmppstream".new; -local st = require "util.stanza"; -require "net.httpclient_listener"; -- Required for net.http to work -local http = require "net.http"; +local new_xmpp_stream = require "prosody.util.xmppstream".new; +local st = require "prosody.util.stanza"; +local http = require "prosody.net.http"; local stream_mt = setmetatable({}, { __index = verse.stream_mt }); stream_mt.__index = stream_mt;
--- a/client.lua Tue May 23 19:46:52 2023 +0200 +++ b/client.lua Sat May 20 20:48:03 2023 +0200 @@ -1,10 +1,10 @@ local verse = require "verse"; local stream = verse.stream_mt; -local jid_split = require "util.jid".split; -local adns = require "net.adns"; -local st = require "util.stanza"; -local new_id = require "util.id".short; +local jid_split = require "prosody.util.jid".split; +local adns = require "prosody.net.adns"; +local st = require "prosody.util.stanza"; +local new_id = require "prosody.util.id".short; math.randomseed((require"socket".gettime() * 1000000) % 0x80000000); @@ -19,7 +19,7 @@ return st.iq(attr); end -local new_xmpp_stream = require "util.xmppstream".new; +local new_xmpp_stream = require "prosody.util.xmppstream".new; local xmlns_stream = "http://etherx.jabber.org/streams";
--- a/component.lua Tue May 23 19:46:52 2023 +0200 +++ b/component.lua Sat May 20 20:48:03 2023 +0200 @@ -1,15 +1,15 @@ local verse = require "verse"; local stream_mt = verse.stream_mt; -local jid_split = require "util.jid".split; -local st = require "util.stanza"; -local sha1 = require "util.hashes".sha1; +local jid_split = require "prosody.util.jid".split; +local st = require "prosody.util.stanza"; +local sha1 = require "prosody.util.hashes".sha1; -- Shortcuts to save having to load util.stanza verse.message, verse.presence, verse.iq, verse.stanza, verse.reply, verse.error_reply = st.message, st.presence, st.iq, st.stanza, st.reply, st.error_reply; -local new_xmpp_stream = require "util.xmppstream".new; +local new_xmpp_stream = require "prosody.util.xmppstream".new; local xmlns_stream = "http://etherx.jabber.org/streams"; local xmlns_component = "jabber:component:accept";
--- a/init.lua Tue May 23 19:46:52 2023 +0200 +++ b/init.lua Sat May 20 20:48:03 2023 +0200 @@ -7,11 +7,12 @@ -- Load LuaSec if available pcall(require, "ssl"); -local server = require "net.server"; -local events = require "util.events"; -local logger = require "util.logger"; +local server = require "prosody.net.server_select"; +package.loaded["prosody.net.server"] = server; -- XXX +local events = require "prosody.util.events"; +local logger = require "prosody.util.logger"; -local format = require "util.format".format; +local format = require "prosody.util.format".format; local verse = {}; verse.server = server; @@ -46,7 +47,7 @@ return t; end -verse.add_task = require "util.timer".add_task; +verse.add_task = require "prosody.util.timer".add_task; verse.logger = logger.init; -- COMPAT: Deprecated verse.new_logger = logger.init;
--- a/libs/adhoc.lib.lua Tue May 23 19:46:52 2023 +0200 +++ b/libs/adhoc.lib.lua Sat May 20 20:48:03 2023 +0200 @@ -4,7 +4,7 @@ -- COPYING file in the source package for more information. -- -local st, new_id = require "util.stanza", require "util.id".short; +local st, new_id = require "prosody.util.stanza", require "util.id".short; local xmlns_cmd = "http://jabber.org/protocol/commands";
--- a/plugins/adhoc.lua Tue May 23 19:46:52 2023 +0200 +++ b/plugins/adhoc.lua Sat May 20 20:48:03 2023 +0200 @@ -1,5 +1,5 @@ local verse = require "verse"; -local adhoc = require "lib.adhoc"; +local adhoc = require "verse.lib.adhoc"; local xmlns_commands = "http://jabber.org/protocol/commands"; local xmlns_data = "jabber:x:data";
--- a/plugins/archive.lua Tue May 23 19:46:52 2023 +0200 +++ b/plugins/archive.lua Sat May 20 20:48:03 2023 +0200 @@ -3,15 +3,15 @@ -- (ie not XEP-0136) local verse = require "verse"; -local st = require "util.stanza"; +local st = require "prosody.util.stanza"; local xmlns_mam = "urn:xmpp:mam:2" local xmlns_forward = "urn:xmpp:forward:0"; local xmlns_delay = "urn:xmpp:delay"; -local new_id = require "util.id".short; -local parse_datetime = require "util.datetime".parse; -local datetime = require "util.datetime".datetime; -local dataform = require"util.dataforms".new; -local rsm = require "util.rsm"; +local new_id = require "prosody.util.id".short; +local parse_datetime = require "prosody.util.datetime".parse; +local datetime = require "prosody.util.datetime".datetime; +local dataform = require"prosody.util.dataforms".new; +local rsm = require "prosody.util.rsm"; local NULL = {}; local query_form = dataform {
--- a/plugins/bind.lua Tue May 23 19:46:52 2023 +0200 +++ b/plugins/bind.lua Sat May 20 20:48:03 2023 +0200 @@ -1,5 +1,5 @@ local verse = require "verse"; -local jid = require "util.jid"; +local jid = require "prosody.util.jid"; local xmlns_bind = "urn:ietf:params:xml:ns:xmpp-bind";
--- a/plugins/carbons.lua Tue May 23 19:46:52 2023 +0200 +++ b/plugins/carbons.lua Sat May 20 20:48:03 2023 +0200 @@ -3,8 +3,8 @@ local xmlns_carbons = "urn:xmpp:carbons:2"; local xmlns_forward = "urn:xmpp:forward:0"; local os_time = os.time; -local parse_datetime = require "util.datetime".parse; -local bare_jid = require "util.jid".bare; +local parse_datetime = require "prosody.util.datetime".parse; +local bare_jid = require "prosody.util.jid".bare; -- TODO Check disco for support
--- a/plugins/disco.lua Tue May 23 19:46:52 2023 +0200 +++ b/plugins/disco.lua Sat May 20 20:48:03 2023 +0200 @@ -8,8 +8,8 @@ local verse = require "verse"; local b64 = require("mime").b64; -local sha1 = require("util.hashes").sha1; -local calculate_hash = require "util.caps".calculate_hash; +local sha1 = require("prosody.util.hashes").sha1; +local calculate_hash = require "prosody.util.caps".calculate_hash; local xmlns_caps = "http://jabber.org/protocol/caps"; local xmlns_disco = "http://jabber.org/protocol/disco";
--- a/plugins/groupchat.lua Tue May 23 19:46:52 2023 +0200 +++ b/plugins/groupchat.lua Sat May 20 20:48:03 2023 +0200 @@ -1,6 +1,6 @@ local verse = require "verse"; -local events = require "util.events"; -local jid = require "util.jid"; +local events = require "prosody.util.events"; +local jid = require "prosody.util.jid"; local room_mt = {}; room_mt.__index = room_mt;
--- a/plugins/jingle.lua Tue May 23 19:46:52 2023 +0200 +++ b/plugins/jingle.lua Sat May 20 20:48:03 2023 +0200 @@ -1,6 +1,6 @@ local verse = require "verse"; -local timer = require "util.timer"; -local new_id = require "util.id".short; +local timer = require "prosody.util.timer"; +local new_id = require "prosody.util.id".short; local xmlns_jingle = "urn:xmpp:jingle:1"; local xmlns_jingle_errors = "urn:xmpp:jingle:errors:1";
--- a/plugins/jingle_ibb.lua Tue May 23 19:46:52 2023 +0200 +++ b/plugins/jingle_ibb.lua Sat May 20 20:48:03 2023 +0200 @@ -1,6 +1,6 @@ local verse = require "verse"; -local base64 = require "util.encodings".base64; -local new_id = require "util.id".short; +local base64 = require "prosody.util.encodings".base64; +local new_id = require "prosody.util.id".short; local xmlns_jingle_ibb = "urn:xmpp:jingle:transports:ibb:1"; local xmlns_ibb = "http://jabber.org/protocol/ibb";
--- a/plugins/jingle_s5b.lua Tue May 23 19:46:52 2023 +0200 +++ b/plugins/jingle_s5b.lua Sat May 20 20:48:03 2023 +0200 @@ -2,8 +2,8 @@ local xmlns_s5b = "urn:xmpp:jingle:transports:s5b:1"; local xmlns_bytestreams = "http://jabber.org/protocol/bytestreams"; -local sha1 = require "util.hashes".sha1; -local new_id = require "util.id".short; +local sha1 = require "prosody.util.hashes".sha1; +local new_id = require "prosody.util.id".short; local function negotiate_socks5(conn, hash) local function suppress_connected()
--- a/plugins/legacy.lua Tue May 23 19:46:52 2023 +0200 +++ b/plugins/legacy.lua Sat May 20 20:48:03 2023 +0200 @@ -1,5 +1,5 @@ local verse = require "verse"; -local new_id = require "util.id".short; +local new_id = require "prosody.util.id".short; local xmlns_auth = "jabber:iq:auth";
--- a/plugins/ping.lua Tue May 23 19:46:52 2023 +0200 +++ b/plugins/ping.lua Sat May 20 20:48:03 2023 +0200 @@ -1,6 +1,6 @@ local verse = require "verse"; local gettime = require"socket".gettime; -local new_id = require "util.id".short; +local new_id = require "prosody.util.id".short; local xmlns_ping = "urn:xmpp:ping";
--- a/plugins/presence.lua Tue May 23 19:46:52 2023 +0200 +++ b/plugins/presence.lua Sat May 20 20:48:03 2023 +0200 @@ -1,5 +1,5 @@ local verse = require "verse"; -local st = require "util.stanza"; +local st = require "prosody.util.stanza"; function verse.plugins.presence(stream) stream.last_presence = nil;
--- a/plugins/proxy65.lua Tue May 23 19:46:52 2023 +0200 +++ b/plugins/proxy65.lua Sat May 20 20:48:03 2023 +0200 @@ -1,6 +1,6 @@ local verse = require "verse"; -local new_id = require "util.id".short; -local sha1 = require "util.hashes".sha1; +local new_id = require "prosody.util.id".short; +local sha1 = require "prosody.util.hashes".sha1; local proxy65_mt = {}; proxy65_mt.__index = proxy65_mt;
--- a/plugins/pubsub.lua Tue May 23 19:46:52 2023 +0200 +++ b/plugins/pubsub.lua Sat May 20 20:48:03 2023 +0200 @@ -197,7 +197,7 @@ self.stream:send_iq(pubsub_iq("get", self.service, nil, "configure", self.node) , function(reply) local form = reply:get_child("pubsub"):get_child("configure"):get_cild("x"); - local config = callback(require"util.dataforms".something(form)) + local config = callback(require"prosody.util.dataforms".something(form)) self.stream:send_iq(pubsub_iq("set", config, ...)) end); end
--- a/plugins/roster.lua Tue May 23 19:46:52 2023 +0200 +++ b/plugins/roster.lua Sat May 20 20:48:03 2023 +0200 @@ -1,5 +1,5 @@ local verse = require "verse"; -local bare_jid = require "util.jid".bare; +local bare_jid = require "prosody.util.jid".bare; local xmlns_roster = "jabber:iq:roster"; local xmlns_rosterver = "urn:xmpp:features:rosterver";
--- a/plugins/sasl.lua Tue May 23 19:46:52 2023 +0200 +++ b/plugins/sasl.lua Sat May 20 20:48:03 2023 +0200 @@ -19,7 +19,7 @@ offered[mech] = true; if not mechanisms[mech] then local name = mech:match("[^-]+"); - local ok, impl = pcall(require, "util.sasl."..name:lower()); + local ok, impl = pcall(require, "verse.util.sasl."..name:lower()); if ok then stream:debug("Loaded SASL %s module", name); mechanisms[mech], preference[mech] = impl(stream, mech);
--- a/plugins/time.lua Tue May 23 19:46:52 2023 +0200 +++ b/plugins/time.lua Sat May 20 20:48:03 2023 +0200 @@ -1,5 +1,5 @@ local verse = require "verse"; -local dt = require "util.datetime"; +local dt = require "prosody.util.datetime"; local xmlns_time = "urn:xmpp:time";
--- a/plugins/vcard.lua Tue May 23 19:46:52 2023 +0200 +++ b/plugins/vcard.lua Sat May 20 20:48:03 2023 +0200 @@ -1,5 +1,5 @@ local verse = require "verse"; -local vcard = require "util.vcard"; +local vcard = require "prosody.util.vcard"; local xmlns_vcard = "vcard-temp";
--- a/plugins/vcard_update.lua Tue May 23 19:46:52 2023 +0200 +++ b/plugins/vcard_update.lua Sat May 20 20:48:03 2023 +0200 @@ -3,10 +3,10 @@ -- local xmlns_vcard = "vcard-temp"; local xmlns_vcard_update = "vcard-temp:x:update"; -local sha1 = require("util.hashes").sha1; +local sha1 = require("prosody.util.hashes").sha1; local ok, fun = pcall(function() - local unb64 = require("util.encodings").base64.decode; + local unb64 = require("prosody.util.encodings").base64.decode; assert(unb64("SGVsbG8=") == "Hello") return unb64; end);
--- a/squishy Tue May 23 19:46:52 2023 +0200 +++ b/squishy Sat May 20 20:48:03 2023 +0200 @@ -31,7 +31,7 @@ Module "util.promise" "util/promise.lua" Module "net.adns" "net/unbound.lua" Module "util.dns" "util/dns.lua" -Module "net.server" "net/server_select.lua" +Module "net.server_select" "net/server_select.lua" Module "util.xmppstream" "util/xmppstream.lua" Module "util.jid" "util/jid.lua" Module "util.events" "util/events.lua"
--- a/util/dataforms.lua Tue May 23 19:46:52 2023 +0200 +++ b/util/dataforms.lua Sat May 20 20:48:03 2023 +0200 @@ -12,8 +12,8 @@ local tonumber = tonumber; local tostring = tostring; local t_concat = table.concat; -local st = require "util.stanza"; -local jid_prep = require "util.jid".prep; +local st = require "prosody.util.stanza"; +local jid_prep = require "prosody.util.jid".prep; local _ENV = nil; -- luacheck: std none
--- a/util/rsm.lua Tue May 23 19:46:52 2023 +0200 +++ b/util/rsm.lua Sat May 20 20:48:03 2023 +0200 @@ -1,4 +1,4 @@ -local stanza = require"util.stanza".stanza; +local stanza = require"prosody.util.stanza".stanza; local tostring, tonumber = tostring, tonumber; local type = type; local pairs = pairs;
--- a/util/sasl/scram.lua Tue May 23 19:46:52 2023 +0200 +++ b/util/sasl/scram.lua Sat May 20 20:48:03 2023 +0200 @@ -1,8 +1,8 @@ local base64, unbase64 = require "mime".b64, require"mime".unb64; -local hashes = require"util.hashes"; +local hashes = require"prosody.util.hashes"; local bit = require"bit"; -local random = require"util.random"; +local random = require"prosody.util.random"; local tonumber = tonumber; local char, byte = string.char, string.byte;
--- a/util/sha1.lua Tue May 23 19:46:52 2023 +0200 +++ b/util/sha1.lua Sat May 20 20:48:03 2023 +0200 @@ -13,7 +13,7 @@ local strbyte = string.byte local strsub = string.sub local floor = math.floor -local bit = bit32 or require "util.bit" +local bit = bit32 or require "prosody.util.bit" local bnot = bit.bnot local band = bit.band local bor = bit.bor
--- a/util/vcard.lua Tue May 23 19:46:52 2023 +0200 +++ b/util/vcard.lua Sat May 20 20:48:03 2023 +0200 @@ -7,7 +7,7 @@ -- TODO -- Fix folding. -local st = require "util.stanza"; +local st = require "prosody.util.stanza"; local t_insert, t_concat = table.insert, table.concat; local type = type; local next, pairs, ipairs = next, pairs, ipairs;