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
);
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
);
21 module
:hook("stanza/"..xmlns_csi
..":active", refire_event("csi-client-active"));
22 module
:hook("stanza/"..xmlns_csi
..":inactive", refire_event("csi-client-inactive"));