Software /
code /
prosody
Changeset
6432:388786af0dd2
mod_pep_plus: Add pubsub service objects to an item list
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 27 Sep 2014 19:00:09 +0200 |
parents | 6431:540f4e33394a |
children | 6442:0f4025abbe8f |
files | plugins/mod_pep_plus.lua |
diffstat | 1 files changed, 7 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_pep_plus.lua Fri Sep 26 17:34:15 2014 +0100 +++ b/plugins/mod_pep_plus.lua Sat Sep 27 19:00:09 2014 +0200 @@ -55,10 +55,11 @@ end function get_pep_service(name) - if services[name] then - return services[name]; + local service = services[name]; + if service then + return service; end - services[name] = pubsub.new({ + service = pubsub.new({ capabilities = { none = { create = false; @@ -166,7 +167,9 @@ normalize_jid = jid_bare; }); - return services[name]; + services[name] = service; + module:add_item("pep-service", { service = service, jid = name }); + return service; end function handle_pubsub_iq(event)