38 end |
38 end |
39 -- TODO fire post processing events |
39 -- TODO fire post processing events |
40 if stanza.attr.type == "get" or stanza.attr.type == "set" then |
40 if stanza.attr.type == "get" or stanza.attr.type == "set" then |
41 return module:fire_event("iq/bare/"..stanza.tags[1].attr.xmlns..":"..stanza.tags[1].name, data); |
41 return module:fire_event("iq/bare/"..stanza.tags[1].attr.xmlns..":"..stanza.tags[1].name, data); |
42 else |
42 else |
43 module:fire_event("iq/bare/"..stanza.tags[1].attr.xmlns..":"..stanza.tags[1].name, data); |
43 module:fire_event("iq/bare/"..stanza.attr.id, data); |
44 return true; |
44 return true; |
45 end |
45 end |
46 end); |
46 end); |
47 |
47 |
48 module:hook("iq/host", function(data) |
48 module:hook("iq/host", function(data) |
50 local origin, stanza = data.origin, data.stanza; |
50 local origin, stanza = data.origin, data.stanza; |
51 |
51 |
52 if stanza.attr.type == "get" or stanza.attr.type == "set" then |
52 if stanza.attr.type == "get" or stanza.attr.type == "set" then |
53 return module:fire_event("iq/host/"..stanza.tags[1].attr.xmlns..":"..stanza.tags[1].name, data); |
53 return module:fire_event("iq/host/"..stanza.tags[1].attr.xmlns..":"..stanza.tags[1].name, data); |
54 else |
54 else |
55 module:fire_event("iq/host/"..stanza.tags[1].attr.xmlns..":"..stanza.tags[1].name, data); |
55 module:fire_event("iq/host/"..stanza.attr.id, data); |
56 return true; |
56 return true; |
57 end |
57 end |
58 end); |
58 end); |