mod_s2s: Handle authentication of s2sin and s2sout the same way
[prosody.git] / plugins / mod_csi.lua
blob84476caccd41cc499d7c4d53a26dc6dda1be4d0c
1 local st = require "util.stanza";
2 local xmlns_csi = "urn:xmpp:csi:0";
3 local csi_feature = st.stanza("csi", { xmlns = xmlns_csi });
5 module:hook("stream-features", function (event)
6 if event.origin.username then
7 event.features:add_child(csi_feature);
8 end
9 end);
11 function refire_event(name)
12 return function (event)
13 if event.origin.username then
14 event.origin.state = event.stanza.name;
15 module:fire_event(name, event);
16 return true;
17 end
18 end;
19 end
21 module:hook("stanza/"..xmlns_csi..":active", refire_event("csi-client-active"));
22 module:hook("stanza/"..xmlns_csi..":inactive", refire_event("csi-client-inactive"));