Annotate

plugins/mod_iq.lua @ 1233:4c8c3d7d9c27

mod_iq: Initial commit
author Waqas Hussain <waqas20@gmail.com>
date Sat, 30 May 2009 17:38:53 +0500
child 1234:0ff02499f05c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1233
4c8c3d7d9c27 mod_iq: Initial commit
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
1
4c8c3d7d9c27 mod_iq: Initial commit
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
2 module:hook("iq/full", function(data)
4c8c3d7d9c27 mod_iq: Initial commit
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
3 -- IQ to full JID recieved
4c8c3d7d9c27 mod_iq: Initial commit
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
4 local origin, stanza = data.origin, data.stanza;
4c8c3d7d9c27 mod_iq: Initial commit
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
5
4c8c3d7d9c27 mod_iq: Initial commit
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
6 local session = full_sessions[stanza.attr.to];
4c8c3d7d9c27 mod_iq: Initial commit
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
7 if session then
4c8c3d7d9c27 mod_iq: Initial commit
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
8 -- TODO fire post processing event
4c8c3d7d9c27 mod_iq: Initial commit
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
9 session.send(stanza);
4c8c3d7d9c27 mod_iq: Initial commit
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
10 return true;
4c8c3d7d9c27 mod_iq: Initial commit
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
11 else -- resource not online
4c8c3d7d9c27 mod_iq: Initial commit
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
12 -- TODO error reply
4c8c3d7d9c27 mod_iq: Initial commit
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
13 end
4c8c3d7d9c27 mod_iq: Initial commit
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
14 end);
4c8c3d7d9c27 mod_iq: Initial commit
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
15
4c8c3d7d9c27 mod_iq: Initial commit
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
16 module:hook("iq/bare", function(data)
4c8c3d7d9c27 mod_iq: Initial commit
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
17 -- IQ to bare JID recieved
4c8c3d7d9c27 mod_iq: Initial commit
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
18 local origin, stanza = data.origin, data.stanza;
4c8c3d7d9c27 mod_iq: Initial commit
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
19
4c8c3d7d9c27 mod_iq: Initial commit
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
20 -- TODO if not user exists, return an error
4c8c3d7d9c27 mod_iq: Initial commit
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
21 -- TODO fire post processing events
4c8c3d7d9c27 mod_iq: Initial commit
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
22 -- TODO fire event with the xmlns:tag of the child, or with the id of errors and results
4c8c3d7d9c27 mod_iq: Initial commit
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
23 end);
4c8c3d7d9c27 mod_iq: Initial commit
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
24
4c8c3d7d9c27 mod_iq: Initial commit
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
25 module:hook("iq/host", function(data)
4c8c3d7d9c27 mod_iq: Initial commit
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
26 -- IQ to a local host recieved
4c8c3d7d9c27 mod_iq: Initial commit
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
27 local origin, stanza = data.origin, data.stanza;
4c8c3d7d9c27 mod_iq: Initial commit
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
28
4c8c3d7d9c27 mod_iq: Initial commit
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
29 -- TODO fire event with the xmlns:tag of the child, or with the id of errors and results
4c8c3d7d9c27 mod_iq: Initial commit
Waqas Hussain <waqas20@gmail.com>
parents:
diff changeset
30 end);