Merge 0.6.2/waqas with 0.6.2/MattJ
[prosody.git] / plugins / mod_iq.lua
index ed89688ae2fa68b86809b873a1f51c39b4565f98..5be045335c478e256913228207d31fc76b6f3719 100644 (file)
@@ -1,3 +1,11 @@
+-- Prosody IM
+-- Copyright (C) 2008-2009 Matthew Wild
+-- Copyright (C) 2008-2009 Waqas Hussain
+-- 
+-- This project is MIT/X11 licensed. Please see the
+-- COPYING file in the source package for more information.
+--
+
 
 local st = require "util.stanza";
 local jid_split = require "util.jid".split;
@@ -40,7 +48,8 @@ module:hook("iq/bare", function(data)
        if stanza.attr.type == "get" or stanza.attr.type == "set" then
                return module:fire_event("iq/bare/"..stanza.tags[1].attr.xmlns..":"..stanza.tags[1].name, data);
        else
-               return true; -- TODO do something with results and errors
+               module:fire_event("iq/bare/"..stanza.attr.id, data);
+               return true;
        end
 end);
 
@@ -51,6 +60,7 @@ module:hook("iq/host", function(data)
        if stanza.attr.type == "get" or stanza.attr.type == "set" then
                return module:fire_event("iq/host/"..stanza.tags[1].attr.xmlns..":"..stanza.tags[1].name, data);
        else
-               return true; -- TODO do something with results and errors
+               module:fire_event("iq/host/"..stanza.attr.id, data);
+               return true;
        end
 end);