plugins/mod_iq.lua

changeset 1233
4c8c3d7d9c27
child 1234
0ff02499f05c
equal deleted inserted replaced
1232:6ddbb583f067 1233:4c8c3d7d9c27
1
2 module:hook("iq/full", function(data)
3 -- IQ to full JID recieved
4 local origin, stanza = data.origin, data.stanza;
5
6 local session = full_sessions[stanza.attr.to];
7 if session then
8 -- TODO fire post processing event
9 session.send(stanza);
10 return true;
11 else -- resource not online
12 -- TODO error reply
13 end
14 end);
15
16 module:hook("iq/bare", function(data)
17 -- IQ to bare JID recieved
18 local origin, stanza = data.origin, data.stanza;
19
20 -- TODO if not user exists, return an error
21 -- TODO fire post processing events
22 -- TODO fire event with the xmlns:tag of the child, or with the id of errors and results
23 end);
24
25 module:hook("iq/host", function(data)
26 -- IQ to a local host recieved
27 local origin, stanza = data.origin, data.stanza;
28
29 -- TODO fire event with the xmlns:tag of the child, or with the id of errors and results
30 end);

mercurial