aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_pubsub/pubsub.lib.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-06-26 20:00:07 +0200
committerKim Alvefur <zash@zash.se>2018-06-26 20:00:07 +0200
commitad621959b8e22774b6025a582e2e8dbb36b45026 (patch)
tree7258cf0b00f4fc8c93c49947fbe27d2e52813ab0 /plugins/mod_pubsub/pubsub.lib.lua
parent3b0aeea254169784024dacaa34c07f53a20ff432 (diff)
downloadprosody-ad621959b8e22774b6025a582e2e8dbb36b45026.tar.gz
prosody-ad621959b8e22774b6025a582e2e8dbb36b45026.zip
mod_pubsub: Add boilerplate for changing affiliations
Diffstat (limited to 'plugins/mod_pubsub/pubsub.lib.lua')
-rw-r--r--plugins/mod_pubsub/pubsub.lib.lua21
1 files changed, 19 insertions, 2 deletions
diff --git a/plugins/mod_pubsub/pubsub.lib.lua b/plugins/mod_pubsub/pubsub.lib.lua
index 96360677..9ef9597b 100644
--- a/plugins/mod_pubsub/pubsub.lib.lua
+++ b/plugins/mod_pubsub/pubsub.lib.lua
@@ -483,10 +483,27 @@ function handlers.owner_get_affiliations(origin, stanza, affiliations, service)
return true;
end
---[[ TODO
function handlers.owner_set_affiliations(origin, stanza, affiliations, service)
+ local node = affiliations.attr.node;
+ if not node then
+ origin.send(pubsub_error_reply(stanza, "nodeid-required"));
+ return true;
+ end
+ if not service:may(node, stanza.attr.from, "set_affiliation") then
+ origin.send(pubsub_error_reply(stanza, "forbidden"));
+ return true;
+ end
+
+ local node_obj = service.nodes[node];
+ if not node_obj then
+ origin.send(pubsub_error_reply(stanza, "item-not-found"));
+ return true;
+ end
+
+ local reply = st.error_reply(stanza, "wait", "not-implemented", "yet");
+ origin.send(reply);
+ return true;
end
---]]
local function create_encapsulating_item(id, payload)
local item = st.stanza("item", { id = id, xmlns = xmlns_pubsub });