Software /
code /
prosody
Comparison
plugins/mod_pep.lua @ 9538:07665733b332
mod_pep: Add all pubsub service objects to item API in order to behave across reloads
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 20 Oct 2018 20:23:23 +0200 |
parent | 9205:2e710b618440 |
child | 9540:8cdd7fec6aa7 |
comparison
equal
deleted
inserted
replaced
9537:5fe1b08e6353 | 9538:07665733b332 |
---|---|
41 end | 41 end |
42 | 42 |
43 function module.restore(data) | 43 function module.restore(data) |
44 services = data.services; | 44 services = data.services; |
45 recipients = data.recipients; | 45 recipients = data.recipients; |
46 for username, service in pairs(services) do | |
47 local user_bare = jid_join(username, host); | |
48 module:add_item("pep-service", { service = service, jid = user_bare }); | |
49 end | |
46 end | 50 end |
47 | 51 |
48 function is_item_stanza(item) | 52 function is_item_stanza(item) |
49 return st.is_stanza(item) and item.attr.xmlns == xmlns_pubsub and item.name == "item"; | 53 return st.is_stanza(item) and item.attr.xmlns == xmlns_pubsub and item.name == "item"; |
50 end | 54 end |