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()); |