28 if a.from and bare_jid(a.from) ~= selfjid then |
28 if a.from and bare_jid(a.from) ~= selfjid then |
29 print("From ".. bare_jid(a.from)); |
29 print("From ".. bare_jid(a.from)); |
30 end |
30 end |
31 print(m:get_child_text"body"); |
31 print(m:get_child_text"body"); |
32 print""; |
32 print""; |
|
33 end |
|
34 if opts.format == "raw" then |
|
35 local st = require"util.stanza"; |
|
36 local datetime = require"util.datetime".datetime; |
|
37 function print_message(i) |
|
38 print(st.stanza("forwarded",{xmlns="urn:xmpp:forward:0"}) |
|
39 :tag("delay", {xmlns="urn:xmpp:delay", stamp=datetime(i.stamp)}):up() |
|
40 :add_child(i.message)); |
|
41 end |
33 end |
42 end |
34 |
43 |
35 local function on_connect(conn) |
44 local function on_connect(conn) |
36 if opts.debug then |
45 if opts.debug then |
37 conn:hook("stanza-out", print); |
46 conn:hook("stanza-out", print); |