mcbot/cmds/xmpp.lua
author Mikael Berthe <mikael@lilotux.net>
Fri, 01 Apr 2011 08:23:28 +0200
changeset 52 4efe459ca7f1
parent 51 a3e9f8f9d969
permissions -rw-r--r--
xmpp: fix new link description (RFC6122)


-- Ugly module with hardcoded URLs to the XMPP draft URLs...
-- Also, see http://datatracker.ietf.org/doc/

local xmpp = { ["desc"] = "Give URLs to XMPP documents" }

function xmpp.cmd (args)
    --[[
    local xmppbaseurl = "http://datatracker.ietf.org/doc/"
    local urls = {}

    urls["3920"] = {
        ["desc"] = "Core",
        ["url"] = xmppbaseurl.."draft-ietf-xmpp-3920bis/",
    }
    urls["3921"] = {
        ["desc"] = "Instant Messaging and Presence",
        ["url"] = xmppbaseurl.."draft-ietf-xmpp-3921bis/",
    }
    --]]

    local xmppbaseurl = "http://tools.ietf.org/html/"
    local urls = {}

    urls["6120"] = {
        ["desc"] = "Core",
        ["url"] = xmppbaseurl.."rfc6120",
    }
    urls["6121"] = {
        ["desc"] = "Instant Messaging and Presence",
        ["url"] = xmppbaseurl.."rfc6121",
    }
    urls["6122"] = {
        ["desc"] = "Address Format",
        ["url"] = xmppbaseurl.."rfc6122",
    }

    local r = "XMPP is the eXtensible Messaging and Presence Protocol. See:\n"
    for k, urltable in pairs(urls) do
        r = r .. urltable.desc..": <"..urltable.url..">\n"
    end
    r = r:gsub("\n+$", "")

    return r
end

mcbot_register_command("xmpp", xmpp)