Mercurial > libervia-backend
diff 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 |
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0163.py Mon Apr 11 12:47:35 2011 +0200 +++ b/src/plugins/plugin_xep_0163.py Tue Apr 12 20:40:47 2011 +0200 @@ -62,14 +62,15 @@ 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")