clix.receive: Suppress history from chatrooms unless -h/--history is supplied

Thu, 07 Jan 2010 21:24:47 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Thu, 07 Jan 2010 21:24:47 +0000
changeset 22
19c5a66837ed
parent 21
cdeb02d9546d
child 23
c5f04bdc7c64

clix.receive: Suppress history from chatrooms unless -h/--history is supplied

clix/receive.lua file | annotate | diff | comparison | revisions
--- a/clix/receive.lua	Thu Jan 07 21:22:27 2010 +0000
+++ b/clix/receive.lua	Thu Jan 07 21:24:47 2010 +0000
@@ -1,7 +1,10 @@
+short_opts.h = "history";
+
 return function (opts, args)
 	local function on_message(message)
 		local body = message:get_child("body");
-		if body then
+		local delay = message:get_child("delay", "urn:xmpp:delay");
+		if body and (not delay or opts.history) then
 			print(body:get_text());
 		end
 	end

mercurial