comparison mod_cloud_notify/mod_cloud_notify.lua @ 2200:e9e38ae8037f

mod_cloud_notify: Advertise feature on bare jid disco (thanks iNPUTmice)
author Kim Alvefur <zash@zash.se>
date Mon, 06 Jun 2016 15:25:29 +0200
parents eb53a830864c
children eb5555a3a535
comparison
equal deleted inserted replaced
2199:2582d09d2ec4 2200:e9e38ae8037f
16 16
17 -- For keeping state across reloads 17 -- For keeping state across reloads
18 local push_enabled = module:shared("push-enabled-users"); 18 local push_enabled = module:shared("push-enabled-users");
19 19
20 -- http://xmpp.org/extensions/xep-0357.html#disco 20 -- http://xmpp.org/extensions/xep-0357.html#disco
21 module:add_feature(xmlns_push); 21 module:hook("account-disco-info", function(event)
22 (event.reply or event.stanza):tag("feature", {var=xmlns_push}):up();
23 end);
22 24
23 -- http://xmpp.org/extensions/xep-0357.html#enabling 25 -- http://xmpp.org/extensions/xep-0357.html#enabling
24 module:hook("iq-set/self/"..xmlns_push..":enable", function (event) 26 module:hook("iq-set/self/"..xmlns_push..":enable", function (event)
25 local origin, stanza = event.origin, event.stanza; 27 local origin, stanza = event.origin, event.stanza;
26 -- MUST contain a 'jid' attribute of the XMPP Push Service being enabled 28 -- MUST contain a 'jid' attribute of the XMPP Push Service being enabled