|
1 local verse = require "verse"; |
|
2 local parse_xml = require "scansion.xml".parse; |
|
3 return { |
|
4 _validate = function (client) |
|
5 assert(client.jid, "No JID specified"); |
|
6 client.stream = verse.new(); |
|
7 end; |
|
8 |
|
9 connects = function (client) |
|
10 client.stream:connect(client.jid, client.password); |
|
11 end; |
|
12 |
|
13 sends = function (client, data) |
|
14 print(("%q"):format(table.concat(data))) |
|
15 print(parse_xml(table.concat(data))); |
|
16 print(stanza) |
|
17 end; |
|
18 |
|
19 receives = function (client, data) |
|
20 end; |
|
21 |
|
22 disconnects = function (client) |
|
23 end; |
|
24 } |