# HG changeset patch # User Goffi # Date 1448317841 -3600 # Node ID 069abd15354f4f1ff0b1c169b806b02c60c225c4 # Parent ad2ad28b89235e55b5fee888cb863c6ac91df811 plugin XEP-0277: checkFeatures implemented diff -r ad2ad28b8923 -r 069abd15354f src/plugins/plugin_xep_0277.py --- 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):