scansion/objects/client.lua

changeset 10
75bf4c021461
parent 8
42b4e73c0d30
child 15
0441673df075
equal deleted inserted replaced
9:15e9d47941bd 10:75bf4c021461
11 11
12 return { 12 return {
13 _validate = function (client) 13 _validate = function (client)
14 assert(client.jid, "No JID specified"); 14 assert(client.jid, "No JID specified");
15 client.stream = verse.new(); 15 client.stream = verse.new();
16 client.stream:hook("stanza", function (stanza) print("Stanza:", stanza) end);
17
18 -- This one prints all received data
19 client.stream:hook("incoming-raw", print, 1000);
20 client.stream:hook("outgoing-raw", print, 1000);
21
16 end; 22 end;
17 23
18 connects = function (client) 24 connects = function (client)
19 local wait, done = async.waiter(); 25 local wait, done = async.waiter();
20 client.stream:hook("ready", function () print"aha" done() end); 26 client.stream:hook("ready", function () print"aha" done() end);

mercurial