diff src/plugins/plugin_xep_0277.py @ 1656:069abd15354f

plugin XEP-0277: checkFeatures implemented
author Goffi <goffi@goffi.org>
date Mon, 23 Nov 2015 23:30:41 +0100
parents b58c8b4715c6
children 96ee986dab3c
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):