changeset 1656:069abd15354f

plugin XEP-0277: checkFeatures implemented
author Goffi <goffi@goffi.org>
date Mon, 23 Nov 2015 23:30:41 +0100
parents ad2ad28b8923
children 62cd8fc1aef7
files src/plugins/plugin_xep_0277.py
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0277.py	Mon Nov 23 23:30:41 2015 +0100
+++ b/src/plugins/plugin_xep_0277.py	Mon Nov 23 23:30:41 2015 +0100
@@ -104,6 +104,17 @@
         host.bridge.addMethod("mbGetAtom", ".plugin", in_sign='ssiasa{ss}s', out_sign='s',
                               method=self._mbGetAtom, async=True)
 
+    def _checkFeaturesCb(self, available):
+        return {'available': C.BOOL_TRUE}
+
+    def _checkFeaturesEb(self, fail):
+        return {'available': C.BOOL_FALSE}
+
+    def getFeatures(self, profile):
+        d = self.host.checkFeatures([], identity=('pubsub', 'pep'), profile=profile)
+        d.addCallbacks(self._checkFeaturesCb, self._checkFeaturesEb)
+        return d
+
     ## plugin management methods ##
 
     def _itemsReceived(self, itemsEvent, profile):