Diff

client.lua @ 166:3499b4ea3277

verse.client: Fire 'stanza-out' and {message,presence,iq}'-out' for outgoing stanzas
author Matthew Wild <mwild1@gmail.com>
date Wed, 15 Dec 2010 14:52:37 +0000
parent 161:b177bcea2006
child 171:741f5311d30c
line wrap: on
line diff
--- a/client.lua	Wed Dec 15 14:50:10 2010 +0000
+++ b/client.lua	Wed Dec 15 14:52:37 2010 +0000
@@ -107,6 +107,18 @@
 		return ret;
 	end, -1);
 
+	self:hook("outgoing", function (data)
+		if data.name then
+			self:event("stanza-out", data);
+		end
+	end);
+	
+	self:hook("stanza-out", function (stanza)
+		if not stanza.attr.xmlns then
+			self:event(stanza.name.."-out", stanza);
+		end
+	end);
+	
 	local function stream_ready()
 		self:event("ready");
 	end