I've recently released version .7 of the Jabber framework. The
radio-dev-worthy news for this release is the beginning of an event
notification system, where you can register scripts for the system to
call when certain things happen, like the framework receives a message
or a presence event.
This means that this is a good time to grab the framework and start
actually playing with it. ;-) For instance, here's an echoing message
handler:
on echo(from, type, body, subject, thread)
{
jabber.messages.message(connectionReference, from, body, subject:
subject, type: type, thread:thread );
}
and to register the callback,
conRef = jabber.openConnection();
jabber.registerHandler(conRef, "message", @echo);
Of course, "@echo" must point somewhere global.
Bot writing is now possible, and as easy as I can possibly make it. ;-)
Documentation is, as always, at http://127.0.0.1:5335/Jabber . Other
changes have been made; consult http://127.0.0.1:5335/Jabber/changes .
If you want to be wacky, you could try this:
on toWeblog(from, type, body, subject, thread)
{
radio.weblog.post(body);
radio.weblog.publish();
}
jabber.registerHandler(conRef, "message", @toWeblog);
But I'd recommend against advertising that; it's a little light on
security, to say the least. ;-)