Monday, November 08, 2010 at 12:06 AM.

system.verbs.builtins.tcp.im.builtinDrivers.jabber.code.examples.presenceTrackingShell

on presenceTrackingShell (from, type, status, priority, show) {
	<<Changes:
		<<5/13/02; 11:10:53 PM by JB
			<<Changelog created.
	<<This is a shell for a sample application for Jabber: A presence watcher. If you change the jabberId checked in the if statement, you can use Jabber to watch for presence status updates. The idea is to put an image in your web directory, for upstreaming.  file.copy also works pretty well where I use file.writeWholeFile. (Of course this won't run directly...
	if string.lower(from) == JabberIdToCheckPresenceOf {
		local ( f = user.radio.prefs.wwwfolder + "images" + file.getpathchar () + "presence.jpg" );
		if type == "available" {
			file.writeWholeFile ( f, somePictureForOnline)};
		if type == "unavailable" {
			file.writeWholeFile ( f, somePictureForOffline )}}};
tcp.im.builtinDrivers.jabber.code.registerHandler ( "presence", this )



This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.