51 client.stream:hook("stanza", function (s) client.log("Stanza: %s", s) end); |
51 client.stream:hook("stanza", function (s) client.log("Stanza: %s", s) end); |
52 end; |
52 end; |
53 |
53 |
54 connects = function (client) |
54 connects = function (client) |
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") client.stream.conn:pause() end); |
56 client.stream:hook("ready", function () |
|
57 client.log"ready" |
|
58 done() |
|
59 client.log("ready done") |
|
60 client.stream.conn:pause() |
|
61 end); |
57 client.stream:connect_client(client.jid, client.password); |
62 client.stream:connect_client(client.jid, client.password); |
58 wait(); |
63 wait(); |
59 client.full_jid = client.stream.jid; |
64 client.full_jid = client.stream.jid; |
60 client.host = client.stream.host; |
65 client.host = client.stream.host; |
61 end; |
66 end; |