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