# HG changeset patch # User Kim Alvefur # Date 1469700609 -7200 # Node ID 122cb5f4930f93e820fbc598b31db6bf3235db5e # Parent 97ebd28a8a75dcd41fcd71b968c2a6e61f9a0afa mod_cloud_notify: Cache in local diff -r 97ebd28a8a75 -r 122cb5f4930f mod_cloud_notify/mod_cloud_notify.lua --- a/mod_cloud_notify/mod_cloud_notify.lua Tue Jul 26 13:29:51 2016 +0200 +++ b/mod_cloud_notify/mod_cloud_notify.lua Thu Jul 28 12:10:09 2016 +0200 @@ -26,16 +26,17 @@ -- http://xmpp.org/extensions/xep-0357.html#enabling module:hook("iq-set/self/"..xmlns_push..":enable", function (event) local origin, stanza = event.origin, event.stanza; + local enable = stanza.tags[1]; origin.log("debug", "Attempting to enable push notifications"); -- MUST contain a 'jid' attribute of the XMPP Push Service being enabled - local push_jid = stanza.tags[1].attr.jid; + local push_jid = enable.attr.jid; -- SHOULD contain a 'node' attribute - local push_node = stanza.tags[1].attr.node; + local push_node = enable.attr.node; if not push_jid then origin.send(st.error_reply(stanza, "modify", "bad-request", "Missing jid")); return true; end - local publish_options = stanza.tags[1].tags[1]; + local publish_options = enable.tags[1]; if publish_options and ( publish_options.name ~= "x" or publish_options.attr.xmlns ~= "jabber:x:data" ) then origin.send(st.error_reply(stanza, "modify", "bad-request", "Invalid publish options")); return true;