Software /
code /
clix
Changeset
134:d1fa853325b9
clix.raw: Add sevral shorthand functions for common queries
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 14 Nov 2020 15:42:04 +0100 |
parents | 133:be3b857e991f |
children | 135:c8cad3c42f3d |
files | clix/raw.lua |
diffstat | 1 files changed, 15 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/clix/raw.lua Sat Nov 14 15:33:35 2020 +0100 +++ b/clix/raw.lua Sat Nov 14 15:42:04 2020 +0100 @@ -58,6 +58,21 @@ ping = function(host) return verse.iq{ type="get", to=host}:tag("ping", {xmlns="urn:xmpp:ping"}); end, + version = function(host) + return verse.iq{ type="get", to=host}:query"jabber:iq:version"; + end, + vcard = function(who) + return verse.iq{ type="get", to=who}:tag("vCard",{xmlns="vcard-temp"}); + end, + disco = function (to, node) + return verse.iq{ type="get", to=to }:tag("query", { xmlns="http://jabber.org/protocol/disco#info", node = node }); + end, + items = function (to, node) + return verse.iq{ type="get", to=to }:tag("query", { xmlns="http://jabber.org/protocol/disco#items", node = node }); + end, + join = function (roomnick) + return verse.presence({ to=roomnick }):tag("x", { xmlns="http://jabber.org/protocol/muc" }); + end, }}); local function on_incoming(stdin, data) if not data then