Mercurial > prosody-hg
comparison plugins/mod_pep.lua @ 9723:3c6e266391a2
mod_pep: Set an 'id' on notifications
mod_pubsub got this in f2d35eee69c9
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 23 Dec 2018 02:56:10 +0100 |
| parents | 695fae2e16b2 |
| children | fdc42f685557 |
comparison
equal
deleted
inserted
replaced
| 9722:695fae2e16b2 | 9723:3c6e266391a2 |
|---|---|
| 6 local st = require "util.stanza"; | 6 local st = require "util.stanza"; |
| 7 local calculate_hash = require "util.caps".calculate_hash; | 7 local calculate_hash = require "util.caps".calculate_hash; |
| 8 local is_contact_subscribed = require "core.rostermanager".is_contact_subscribed; | 8 local is_contact_subscribed = require "core.rostermanager".is_contact_subscribed; |
| 9 local cache = require "util.cache"; | 9 local cache = require "util.cache"; |
| 10 local set = require "util.set"; | 10 local set = require "util.set"; |
| 11 local new_id = require "util.id".medium; | |
| 11 | 12 |
| 12 local xmlns_pubsub = "http://jabber.org/protocol/pubsub"; | 13 local xmlns_pubsub = "http://jabber.org/protocol/pubsub"; |
| 13 local xmlns_pubsub_event = "http://jabber.org/protocol/pubsub#event"; | 14 local xmlns_pubsub_event = "http://jabber.org/protocol/pubsub#event"; |
| 14 local xmlns_pubsub_owner = "http://jabber.org/protocol/pubsub#owner"; | 15 local xmlns_pubsub_owner = "http://jabber.org/protocol/pubsub#owner"; |
| 15 | 16 |
| 145 item:maptags(function () return nil; end); | 146 item:maptags(function () return nil; end); |
| 146 end | 147 end |
| 147 end | 148 end |
| 148 end | 149 end |
| 149 | 150 |
| 150 local message = st.message({ from = user_bare, type = "headline" }) | 151 local id = new_id(); |
| 152 local message = st.message({ from = user_bare, type = "headline", id = id }) | |
| 151 :tag("event", { xmlns = xmlns_pubsub_event }) | 153 :tag("event", { xmlns = xmlns_pubsub_event }) |
| 152 :tag(kind, { node = node }); | 154 :tag(kind, { node = node }); |
| 153 | 155 |
| 154 if item then | 156 if item then |
| 155 message:add_child(item); | 157 message:add_child(item); |
