clix/raw.lua

changeset 83
040fadcc86f9
parent 68
b7d92ed9c268
child 84
1b4e64176288
equal deleted inserted replaced
82:30f85754b1e0 83:040fadcc86f9
11 if opts.stdin then 11 if opts.stdin then
12 send_xml = io.read("*a"); 12 send_xml = io.read("*a");
13 end 13 end
14 14
15 local function on_connect(conn) 15 local function on_connect(conn)
16 conn:hook("incoming-raw", function (data) print(data) end); 16 local print = print;
17 local function stprint(stanza)
18 if stanza.attr.to == conn.jid then
19 stanza.attr.to = nil;
20 end
21 return print(stanza);
22 end
23 conn:hook("stanza", stprint)
17 if opts.interactive then 24 if opts.interactive then
18 local stdin = { 25 local stdin = {
19 getfd = function () return 0; end; 26 getfd = function () return 0; end;
20 dirty = function (self) return false; end; 27 dirty = function (self) return false; end;
21 settimeout = function () end; 28 settimeout = function () end;

mercurial