56 p = stwrap(verse.presence), |
56 p = stwrap(verse.presence), |
57 iq = stwrap(verse.iq), |
57 iq = stwrap(verse.iq), |
58 ping = function(host) |
58 ping = function(host) |
59 return verse.iq{ type="get", to=host}:tag("ping", {xmlns="urn:xmpp:ping"}); |
59 return verse.iq{ type="get", to=host}:tag("ping", {xmlns="urn:xmpp:ping"}); |
60 end, |
60 end, |
|
61 version = function(host) |
|
62 return verse.iq{ type="get", to=host}:query"jabber:iq:version"; |
|
63 end, |
|
64 vcard = function(who) |
|
65 return verse.iq{ type="get", to=who}:tag("vCard",{xmlns="vcard-temp"}); |
|
66 end, |
|
67 disco = function (to, node) |
|
68 return verse.iq{ type="get", to=to }:tag("query", { xmlns="http://jabber.org/protocol/disco#info", node = node }); |
|
69 end, |
|
70 items = function (to, node) |
|
71 return verse.iq{ type="get", to=to }:tag("query", { xmlns="http://jabber.org/protocol/disco#items", node = node }); |
|
72 end, |
|
73 join = function (roomnick) |
|
74 return verse.presence({ to=roomnick }):tag("x", { xmlns="http://jabber.org/protocol/muc" }); |
|
75 end, |
61 }}); |
76 }}); |
62 local function on_incoming(stdin, data) |
77 local function on_incoming(stdin, data) |
63 if not data then |
78 if not data then |
64 conn:close(); |
79 conn:close(); |
65 return |
80 return |