author | Waqas Hussain <waqas20@gmail.com> |
Sat, 30 May 2009 17:48:12 +0500 | |
changeset 1234 | 0ff02499f05c |
parent 1233 | 4c8c3d7d9c27 |
child 1260 | 04c1fae0eb03 |
permissions | -rw-r--r-- |
1234
0ff02499f05c
mod_message, mod_iq: A little cleanup
Waqas Hussain <waqas20@gmail.com>
parents:
1233
diff
changeset
|
1 |
|
0ff02499f05c
mod_message, mod_iq: A little cleanup
Waqas Hussain <waqas20@gmail.com>
parents:
1233
diff
changeset
|
2 |
local full_sessions = full_sessions; |
0ff02499f05c
mod_message, mod_iq: A little cleanup
Waqas Hussain <waqas20@gmail.com>
parents:
1233
diff
changeset
|
3 |
local bare_sessions = bare_sessions; |
1233 | 4 |
|
5 |
module:hook("iq/full", function(data) |
|
6 |
-- IQ to full JID recieved |
|
7 |
local origin, stanza = data.origin, data.stanza; |
|
8 |
||
9 |
local session = full_sessions[stanza.attr.to]; |
|
10 |
if session then |
|
11 |
-- TODO fire post processing event |
|
12 |
session.send(stanza); |
|
13 |
return true; |
|
14 |
else -- resource not online |
|
15 |
-- TODO error reply |
|
16 |
end |
|
17 |
end); |
|
18 |
||
19 |
module:hook("iq/bare", function(data) |
|
20 |
-- IQ to bare JID recieved |
|
21 |
local origin, stanza = data.origin, data.stanza; |
|
22 |
||
23 |
-- TODO if not user exists, return an error |
|
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 |
|
26 |
end); |
|
27 |
||
28 |
module:hook("iq/host", function(data) |
|
29 |
-- IQ to a local host recieved |
|
30 |
local origin, stanza = data.origin, data.stanza; |
|
31 |
||
32 |
-- TODO fire event with the xmlns:tag of the child, or with the id of errors and results |
|
33 |
end); |