aboutsummaryrefslogtreecommitdiffstats
path: root/util/pubsub.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-05-20 03:27:02 +0200
committerKim Alvefur <zash@zash.se>2018-05-20 03:27:02 +0200
commit9ba89e20b4273a9de409a017ba7d8c3543924d62 (patch)
treeecb36d8acf9791bdc6440e6e980c73113077465a /util/pubsub.lua
parent1700e2669abff791ed57f3bfe167892a4c33c661 (diff)
downloadprosody-9ba89e20b4273a9de409a017ba7d8c3543924d62.tar.gz
prosody-9ba89e20b4273a9de409a017ba7d8c3543924d62.zip
util.pubsub: Don't record the superuser as owner on creation
No need to be set as owner, it has all privileges anyways. Since it’s a boolean instead of a string, its presence may cause weirdness in other code expecting all affiliations to be string JIDs.
Diffstat (limited to 'util/pubsub.lua')
-rw-r--r--util/pubsub.lua14
1 files changed, 8 insertions, 6 deletions
diff --git a/util/pubsub.lua b/util/pubsub.lua
index 3a00aae5..65f6eee7 100644
--- a/util/pubsub.lua
+++ b/util/pubsub.lua
@@ -260,14 +260,16 @@ function service:create(node, actor, options)
self.data[node] = self.config.itemstore(self.nodes[node].config, node);
self.events.fire_event("node-created", { node = node, actor = actor });
- local ok, err = self:set_affiliation(node, true, actor, "owner");
- if not ok then
- self.nodes[node] = nil;
- self.data[node] = nil;
- return ok, err;
+ if actor ~= true then
+ local ok, err = self:set_affiliation(node, true, actor, "owner");
+ if not ok then
+ self.nodes[node] = nil;
+ self.data[node] = nil;
+ return ok, err;
+ end
end
- return ok, err;
+ return true;
end
function service:delete(node, actor)