From f67582a2602fb65109bf5eaf01b4bf1990455844 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 29 Mar 2022 19:58:28 +0200 Subject: mod_storage_xep0227: Improve logging What were we looking at? --- plugins/mod_storage_xep0227.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/mod_storage_xep0227.lua b/plugins/mod_storage_xep0227.lua index c1c7a62c..9c462caa 100644 --- a/plugins/mod_storage_xep0227.lua +++ b/plugins/mod_storage_xep0227.lua @@ -59,7 +59,7 @@ local function getUserElement(xml) end end end - module:log("warn", "Unable to find user element"); + module:log("warn", "Unable to find user element in %s", xml and xml:top_tag() or "nothing"); end local function createOuterXml(user, host) return st.stanza("server-data", {xmlns='urn:xmpp:pie:0'}) -- cgit v1.2.3 From fc6f400997a5dbfe4157cfa512263fe201f072c3 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 31 Mar 2022 18:53:23 +0200 Subject: mod_storage_xep0227: Support basic listing of PEP nodes in absence of pubsub#admin data Allows migrating PEP nodes with default settings --- plugins/mod_storage_xep0227.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/mod_storage_xep0227.lua b/plugins/mod_storage_xep0227.lua index 9c462caa..5b4d3f1a 100644 --- a/plugins/mod_storage_xep0227.lua +++ b/plugins/mod_storage_xep0227.lua @@ -279,6 +279,7 @@ handlers.roster = { }; -- PEP node configuration/etc. (not items) +local xmlns_pubsub = "http://jabber.org/protocol/pubsub"; local xmlns_pubsub_owner = "http://jabber.org/protocol/pubsub#owner"; local lib_pubsub = module:require "pubsub"; handlers.pep = { @@ -300,7 +301,16 @@ handlers.pep = { }; local owner_el = user_el:get_child("pubsub", xmlns_pubsub_owner); if not owner_el then - return nil; + local pubsub_el = user_el:get_child("pubsub", xmlns_pubsub); + if not pubsub_el then + return nil; + end + for node_el in pubsub_el:childtags("items") do + nodes[node_el.attr.node] = { + node = node_el.attr.node; + } + end + return nodes; end for node_el in owner_el:childtags() do local node_name = node_el.attr.node; @@ -396,7 +406,6 @@ handlers.pep = { }; -- PEP items -local xmlns_pubsub = "http://jabber.org/protocol/pubsub"; handlers.pep_ = { _stores = function (self, xml) --luacheck: ignore 212/self local store_names = set.new(); -- cgit v1.2.3 From e626855282e5b813e31c080f4e386975f3841901 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 8 Apr 2022 15:09:19 +0200 Subject: mod_storage_xep0227: Fix conversion of SCRAM into internal format (fix #1741) Looks like this function was a copy of hex_to_base64 without modifying it to do its inverse. --- plugins/mod_storage_xep0227.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/mod_storage_xep0227.lua b/plugins/mod_storage_xep0227.lua index 5b4d3f1a..285428d6 100644 --- a/plugins/mod_storage_xep0227.lua +++ b/plugins/mod_storage_xep0227.lua @@ -72,7 +72,7 @@ local function hex_to_base64(s) end local function base64_to_hex(s) - return base64.encode(hex.decode(s)); + return hex.encode(base64.decode(s)); end local handlers = {}; -- cgit v1.2.3