plugin group blog: group blog now use PEP to take profit of autosubscribe
This commit is contained in:
parent
3728cc251b
commit
e3391fdd80
1 changed files with 75 additions and 44 deletions
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Reference in a new issue