plugin group blog: group blog now use PEP to take profit of autosubscribe

This commit is contained in:
Goffi 2011-04-12 20:40:47 +02:00
commit e3391fdd80

View file

@ -62,14 +62,15 @@ class XEP_0163():
disco_info.extend(map(disco.DiscoFeature, self.pep_events))
return True
def addPEPEvent(self, event_type, name, in_callback, out_callback, notify = True):
def addPEPEvent(self, event_type, name, in_callback, out_callback = None, notify = True):
"""Add a Personal Eventing Protocol event manager
@param event_type: type of the event (always uppercase), can be MOOD, TUNE, etc
@param name: namespace of the node (e.g. http://jabber.org/protocol/mood for User Mood)
@param in_callback: method to call when this event occur
@param out_callback: method to call when we want to publish this event
@param notify: add autosubscribe (+notify) if True"""
self.pep_out_cb[event_type]=out_callback
if out_callback:
self.pep_out_cb[event_type] = out_callback
self.pep_events.add(name)
if notify:
self.pep_events.add(name+"+notify")