equal
deleted
inserted
replaced
7 local jid = require"util.jid"; |
7 local jid = require"util.jid"; |
8 local dataform = require"util.dataforms".new; |
8 local dataform = require"util.dataforms".new; |
9 |
9 |
10 local xmlns_push = "urn:xmpp:push:0"; |
10 local xmlns_push = "urn:xmpp:push:0"; |
11 |
11 |
|
12 -- For keeping state across reloads |
|
13 local push_enabled = module:shared("push-enabled-users"); |
|
14 |
|
15 -- http://xmpp.org/extensions/xep-0357.html#disco |
12 module:add_feature(xmlns_push); |
16 module:add_feature(xmlns_push); |
13 |
|
14 local push_enabled = module:shared("push-enabled-users"); |
|
15 |
17 |
16 -- http://xmpp.org/extensions/xep-0357.html#enabling |
18 -- http://xmpp.org/extensions/xep-0357.html#enabling |
17 module:hook("iq-set/self/"..xmlns_push..":enable", function (event) |
19 module:hook("iq-set/self/"..xmlns_push..":enable", function (event) |
18 local origin, stanza = event.origin, event.stanza; |
20 local origin, stanza = event.origin, event.stanza; |
19 -- MUST contain a 'jid' attribute of the XMPP Push Service being enabled |
21 -- MUST contain a 'jid' attribute of the XMPP Push Service being enabled |