20 -- IQ to bare JID recieved |
20 -- IQ to bare JID recieved |
21 local origin, stanza = data.origin, data.stanza; |
21 local origin, stanza = data.origin, data.stanza; |
22 |
22 |
23 -- TODO if not user exists, return an error |
23 -- TODO if not user exists, return an error |
24 -- TODO fire post processing events |
24 -- TODO fire post processing events |
25 -- TODO fire event with the xmlns:tag of the child, or with the id of errors and results |
25 if #stanza.tags == 1 then |
|
26 return module:fire_event("iq/bare/"..stanza.tags[1].attr.xmlns..":"..stanza.tags[1].name); |
|
27 else |
|
28 return true; -- TODO do something with results and errors |
|
29 end |
26 end); |
30 end); |
27 |
31 |
28 module:hook("iq/host", function(data) |
32 module:hook("iq/host", function(data) |
29 -- IQ to a local host recieved |
33 -- IQ to a local host recieved |
30 local origin, stanza = data.origin, data.stanza; |
34 local origin, stanza = data.origin, data.stanza; |
31 |
35 |
32 -- TODO fire event with the xmlns:tag of the child, or with the id of errors and results |
36 if #stanza.tags == 1 then |
|
37 return module:fire_event("iq/host/"..stanza.tags[1].attr.xmlns..":"..stanza.tags[1].name); |
|
38 else |
|
39 return true; -- TODO do something with results and errors |
|
40 end |
33 end); |
41 end); |