comparison src/plugins/plugin_xep_0163.py @ 311:0aa6ca6cdbdd

plugin group blog: group blog now use PEP to take profit of autosubscribe
author Goffi <goffi@goffi.org>
date Tue, 12 Apr 2011 20:40:47 +0200
parents 59a82af700e2
children f964dcec1611
comparison
equal deleted inserted replaced
310:53adec87d1d7 311:0aa6ca6cdbdd
60 will be filled with PEP features 60 will be filled with PEP features
61 @param profile: profile we are handling""" 61 @param profile: profile we are handling"""
62 disco_info.extend(map(disco.DiscoFeature, self.pep_events)) 62 disco_info.extend(map(disco.DiscoFeature, self.pep_events))
63 return True 63 return True
64 64
65 def addPEPEvent(self, event_type, name, in_callback, out_callback, notify = True): 65 def addPEPEvent(self, event_type, name, in_callback, out_callback = None, notify = True):
66 """Add a Personal Eventing Protocol event manager 66 """Add a Personal Eventing Protocol event manager
67 @param event_type: type of the event (always uppercase), can be MOOD, TUNE, etc 67 @param event_type: type of the event (always uppercase), can be MOOD, TUNE, etc
68 @param name: namespace of the node (e.g. http://jabber.org/protocol/mood for User Mood) 68 @param name: namespace of the node (e.g. http://jabber.org/protocol/mood for User Mood)
69 @param in_callback: method to call when this event occur 69 @param in_callback: method to call when this event occur
70 @param out_callback: method to call when we want to publish this event 70 @param out_callback: method to call when we want to publish this event
71 @param notify: add autosubscribe (+notify) if True""" 71 @param notify: add autosubscribe (+notify) if True"""
72 self.pep_out_cb[event_type]=out_callback 72 if out_callback:
73 self.pep_out_cb[event_type] = out_callback
73 self.pep_events.add(name) 74 self.pep_events.add(name)
74 if notify: 75 if notify:
75 self.pep_events.add(name+"+notify") 76 self.pep_events.add(name+"+notify")
76 self.host.plugins["XEP-0060"].addManagedNode(name, in_callback) 77 self.host.plugins["XEP-0060"].addManagedNode(name, in_callback)
77 78