Changeset

83:040fadcc86f9

clix.raw: Print one incoming stanza per line, instead of raw incoming data.
author Kim Alvefur <zash@zash.se>
date Fri, 29 Jun 2012 20:29:11 +0200
parents 82:30f85754b1e0
children 84:1b4e64176288
files clix/raw.lua
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/clix/raw.lua	Thu Jun 28 14:40:36 2012 +0200
+++ b/clix/raw.lua	Fri Jun 29 20:29:11 2012 +0200
@@ -13,7 +13,14 @@
 	end
 	
 	local function on_connect(conn)
-		conn:hook("incoming-raw", function (data) print(data) end);
+		local print = print;
+		local function stprint(stanza)
+			if stanza.attr.to == conn.jid then
+				stanza.attr.to = nil;
+			end
+			return print(stanza);
+		end
+		conn:hook("stanza", stprint)
 		if opts.interactive then
 			local stdin = {
 				getfd = function () return 0; end;