diff options
author | Kim Alvefur <zash@zash.se> | 2018-05-20 03:27:02 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-05-20 03:27:02 +0200 |
commit | ee9a168e80fc8f5de65465a410e0721120bed827 (patch) | |
tree | ecb36d8acf9791bdc6440e6e980c73113077465a /util | |
parent | 8d28daa0aee129106ec422f7f6b068dada7a49ed (diff) | |
download | prosody-ee9a168e80fc8f5de65465a410e0721120bed827.tar.gz prosody-ee9a168e80fc8f5de65465a410e0721120bed827.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')
-rw-r--r-- | util/pubsub.lua | 14 |
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) |