Changeset

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
parents 165:8c67ea868c06
children 167:a2ae7a9d360f
files client.lua
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
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