plugins/presence_plugin.py
author Mikael Berthe <mikael@lilotux.net>
Sat, 19 May 2007 15:22:09 +0200
changeset 38 a81dc352e96e
parent 17 069f7fd5545d
permissions -rw-r--r--
rss_plugin: remove trailing whitespace

#$ 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)