clix/raw.lua

changeset 133
be3b857e991f
parent 132
3addfb97296c
child 134
d1fa853325b9
equal deleted inserted replaced
132:3addfb97296c 133:be3b857e991f
15 local function on_connect(conn) 15 local function on_connect(conn)
16 local print = print; 16 local print = print;
17 local function stprint(stanza) 17 local function stprint(stanza)
18 if stanza.attr.to == conn.jid then 18 if stanza.attr.to == conn.jid then
19 stanza.attr.to = nil; 19 stanza.attr.to = nil;
20 end
21 if opts.pretty and stanza.indent then
22 return print(stanza:indent(1, " "):pretty_print());
20 end 23 end
21 return print(stanza); 24 return print(stanza);
22 end 25 end
23 conn:hook("stanza", stprint) 26 conn:hook("stanza", stprint)
24 if opts.interactive then 27 if opts.interactive then

mercurial