clix/receive.lua

changeset 22
19c5a66837ed
parent 17
fa9efbef8a0c
child 27
5b58c002d6ad
equal deleted inserted replaced
21:cdeb02d9546d 22:19c5a66837ed
1 short_opts.h = "history";
2
1 return function (opts, args) 3 return function (opts, args)
2 local function on_message(message) 4 local function on_message(message)
3 local body = message:get_child("body"); 5 local body = message:get_child("body");
4 if body then 6 local delay = message:get_child("delay", "urn:xmpp:delay");
7 if body and (not delay or opts.history) then
5 print(body:get_text()); 8 print(body:get_text());
6 end 9 end
7 end 10 end
8 local function on_connect(conn) 11 local function on_connect(conn)
9 conn:hook("message", on_message); 12 conn:hook("message", on_message);

mercurial