equal
deleted
inserted
replaced
|
1 local st = require "util.stanza"; |
|
2 |
|
3 module:depends("csi"); |
|
4 |
|
5 module:add_feature("google:queue"); |
|
6 |
|
7 module:hook("iq-set/self/google:queue:query", function(event) |
|
8 local origin, stanza = event.origin, event.stanza; |
|
9 (origin.log or module._log)("debug", "Google queue invoked (CSI compat mode)") |
|
10 local payload = stanza:get_child("query", "google:queue"); |
|
11 if payload:get_child("enable") then |
|
12 module:fire_event("csi-client-inactive", event); |
|
13 elseif payload:get_child("disable") then |
|
14 module:fire_event("csi-client-active", event); |
|
15 end |
|
16 -- <flush/> is implemented as a noop, any IQ stanza would flush the queue anyways. |
|
17 return origin.send(st.reply(stanza)); |
|
18 end, 10); |