verse.client: Fire 'stanza-out' and {message,presence,iq}'-out' for outgoing stanzas

Wed, 15 Dec 2010 14:52:37 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Wed, 15 Dec 2010 14:52:37 +0000
changeset 166
3499b4ea3277
parent 165
8c67ea868c06
child 167
a2ae7a9d360f

verse.client: Fire 'stanza-out' and {message,presence,iq}'-out' for outgoing stanzas

client.lua file | annotate | diff | comparison | revisions
--- 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

mercurial