clix/receive.lua

changeset 27
5b58c002d6ad
parent 22
19c5a66837ed
equal deleted inserted replaced
26:028c5ffc6d7c 27:5b58c002d6ad
1 short_opts.h = "history"; 1 short_opts.h = "history";
2 2
3 return function (opts, args) 3 return function (opts, args)
4 if opts.short_help then
5 print("Receive and display XMPP messages");
6 return;
7 end
4 local function on_message(message) 8 local function on_message(message)
5 local body = message:get_child("body"); 9 local body = message:get_child("body");
6 local delay = message:get_child("delay", "urn:xmpp:delay"); 10 local delay = message:get_child("delay", "urn:xmpp:delay");
7 if body and (not delay or opts.history) then 11 if body and (not delay or opts.history) then
8 print(body:get_text()); 12 print(body:get_text());

mercurial