55 local wait, done = async.waiter(); |
55 local wait, done = async.waiter(); |
56 client.stream:hook("ready", function () client.log"ready" done() client.log("ready done") end); |
56 client.stream:hook("ready", function () client.log"ready" done() client.log("ready done") end); |
57 client.stream:connect_client(client.jid, client.password); |
57 client.stream:connect_client(client.jid, client.password); |
58 wait(); |
58 wait(); |
59 client.full_jid = client.stream.jid; |
59 client.full_jid = client.stream.jid; |
|
60 client.host = client.stream.host; |
60 end; |
61 end; |
61 |
62 |
62 sends = function (client, data) |
63 sends = function (client, data) |
63 local stanza = fill_vars(client.script, assert(parse_xml((table.concat(data):gsub("\t", " "))))); |
64 local stanza = fill_vars(client.script, assert(parse_xml((table.concat(data):gsub("\t", " "))))); |
64 client.stream:send(stanza); |
65 client.stream:send(stanza); |