plugins/presence_plugin.py
author Mikael Berthe <mikael@lilotux.net>
Sun, 20 May 2007 12:33:55 +0200
changeset 41 ca6e989ca850
parent 17 069f7fd5545d
permissions -rw-r--r--
rss_plugin: Don't send title if it's part of the headline description

#$ neutron_plugin 01

def handler_presence_presence(prs):
	type = prs.getType()
	who = prs.getFrom()
	if not type:
		type = 'available'
	if type == 'subscribe':
		JCON.send(xmpp.Presence(to=who, typ='subscribed'))
		#JCON.send(xmpp.Presence(to=who, typ='subscribe'))
	elif type == 'unsubscribe':
		JCON.send(xmpp.Presence(to=who, typ='unsubscribed'))
		#JCON.send(xmpp.Presence(to=who, typ='unsubscribe'))
	elif type == 'subscribed':
		pass
	elif type == 'unsubscribed':
		pass
	elif type == 'available':
		pass
	elif type == 'unavailable':
		pass

register_presence_handler(handler_presence_presence)