aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2022-04-08 15:17:11 +0200
committerKim Alvefur <zash@zash.se>2022-04-08 15:17:11 +0200
commit09a4bc0446ed73802f7d1a53017bee83d679ec59 (patch)
tree36a6ff66172a15f3916707f3588354dc12948838 /plugins
parent80d23969e90f1841e4bd2352dbdfbcc41ecb6199 (diff)
parente626855282e5b813e31c080f4e386975f3841901 (diff)
downloadprosody-09a4bc0446ed73802f7d1a53017bee83d679ec59.tar.gz
prosody-09a4bc0446ed73802f7d1a53017bee83d679ec59.zip
Merge 0.12->trunk
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_storage_xep0227.lua17
1 files changed, 13 insertions, 4 deletions
diff --git a/plugins/mod_storage_xep0227.lua b/plugins/mod_storage_xep0227.lua
index c1c7a62c..285428d6 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'})
@@ -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 = {};
@@ -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();