Changeset

22:19c5a66837ed

clix.receive: Suppress history from chatrooms unless -h/--history is supplied
author Matthew Wild <mwild1@gmail.com>
date Thu, 07 Jan 2010 21:24:47 +0000
parents 21:cdeb02d9546d
children 23:c5f04bdc7c64
files clix/receive.lua
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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