Comparison

util/pubsub.lua @ 8220:a1b0fa38fca7

util.pubsub: Don't record publisher when superuser privileges are used (eg by modules)
author Kim Alvefur <zash@zash.se>
date Sat, 29 Jul 2017 13:09:57 +0200
parent 8217:5f4e0d67b82a
child 8297:ac5c90230c2c
comparison
equal deleted inserted replaced
8219:2e68ae095645 8220:a1b0fa38fca7
266 return ok, err; 266 return ok, err;
267 end 267 end
268 node_obj = self.nodes[node]; 268 node_obj = self.nodes[node];
269 end 269 end
270 local node_data = self.data[node]; 270 local node_data = self.data[node];
271 item.attr.publisher = actor; 271 if type(actor) == "string" then
272 item.attr.publisher = actor;
273 end
272 local ok = node_data:set(id, item); 274 local ok = node_data:set(id, item);
273 if not ok then 275 if not ok then
274 return nil, "internal-server-error"; 276 return nil, "internal-server-error";
275 end 277 end
276 if type(ok) == "string" then id = ok; end 278 if type(ok) == "string" then id = ok; end