Software /
code /
prosody
Comparison
util/pubsub.lua @ 8212:66173e4b355a
util.pubsub: Add the publisher as an attribute in the item element.
This makes the backend able to obtain the publisher without changing
the API.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sun, 02 Apr 2017 19:08:54 +0100 |
parent | 8211:5cbbe825d9d1 |
child | 8217:5f4e0d67b82a |
comparison
equal
deleted
inserted
replaced
8211:5cbbe825d9d1 | 8212:66173e4b355a |
---|---|
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 local ok = node_data:set(id, item); | 272 local ok = node_data:set(id, item); |
272 if not ok then | 273 if not ok then |
273 return nil, "internal-server-error"; | 274 return nil, "internal-server-error"; |
274 end | 275 end |
275 self.events.fire_event("item-published", { node = node, actor = actor, id = id, item = item }); | 276 self.events.fire_event("item-published", { node = node, actor = actor, id = id, item = item }); |