Software /
code /
verse
Comparison
plugins/pep.lua @ 415:37674f8ce263
verse.plugins.pep: Support taking an item id, default to "current"
XEP-0060 recommends using "current" in section 'Singleton Nodes' and
many PEP use cases follow this pattern.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 20 May 2018 00:56:24 +0200 |
parent | 380:0891b4e27766 |
child | 470:e690759c5072 |
comparison
equal
deleted
inserted
replaced
414:2a5eff919f4a | 415:37674f8ce263 |
---|---|
26 if not(handlers) or #handlers == 0 then | 26 if not(handlers) or #handlers == 0 then |
27 stream:remove_disco_feature(node.."+notify"); | 27 stream:remove_disco_feature(node.."+notify"); |
28 end | 28 end |
29 end | 29 end |
30 | 30 |
31 function stream:publish_pep(item, node) | 31 function stream:publish_pep(item, node, id) |
32 return stream.pubsub:service(nil):node(node or item.attr.xmlns):publish(nil, nil, item) | 32 return stream.pubsub:service(nil):node(node or item.attr.xmlns):publish(id or "current", nil, item) |
33 end | 33 end |
34 end | 34 end |