# HG changeset patch # User Kim Alvefur # Date 1526779622 -7200 # Node ID 6cba2df3817cefc466030b7543adcb5f92436ac7 # Parent 40a7135eb6ac861118e3ea5bdd1f533b8804e1ff 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. diff -r 40a7135eb6ac -r 6cba2df3817c util/pubsub.lua --- a/util/pubsub.lua Mon May 21 01:25:10 2018 +0200 +++ b/util/pubsub.lua Sun May 20 03:27:02 2018 +0200 @@ -260,14 +260,16 @@ 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)