Merge 0.7 with 0.7

Sun, 21 Feb 2010 16:43:29 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Sun, 21 Feb 2010 16:43:29 +0000
changeset 2689
542d633e0280
parent 2685
95d665f20c71 (current diff)
parent 2688
d0d38fcaade0 (diff)
child 2690
6863b629aa6a
child 2693
e60494fbf23f

Merge 0.7 with 0.7

--- a/core/stanza_router.lua	Sun Feb 21 16:42:26 2010 +0000
+++ b/core/stanza_router.lua	Sun Feb 21 16:43:29 2010 +0000
@@ -140,6 +140,7 @@
 			to_type = '/host';
 		else
 			to_type = '/bare';
+			to_self = true;
 		end
 	end
 
--- a/plugins/mod_iq.lua	Sun Feb 21 16:42:26 2010 +0000
+++ b/plugins/mod_iq.lua	Sun Feb 21 16:43:29 2010 +0000
@@ -53,6 +53,18 @@
 	end
 end);
 
+module:hook("iq/self", function(data)
+	-- IQ to bare JID recieved
+	local origin, stanza = data.origin, data.stanza;
+
+	if stanza.attr.type == "get" or stanza.attr.type == "set" then
+		return module:fire_event("iq/self/"..stanza.tags[1].attr.xmlns..":"..stanza.tags[1].name, data);
+	else
+		module:fire_event("iq/self/"..stanza.attr.id, data);
+		return true;
+	end
+end);
+
 module:hook("iq/host", function(data)
 	-- IQ to a local host recieved
 	local origin, stanza = data.origin, data.stanza;

mercurial