diff --git a/src/plugins/plugin_xep_0060.py b/src/plugins/plugin_xep_0060.py index 4b5f5116..189c3622 100755 --- a/src/plugins/plugin_xep_0060.py +++ b/src/plugins/plugin_xep_0060.py @@ -21,6 +21,7 @@ from sat.core.i18n import _ from sat.core.constants import Const as C from sat.core.log import getLogger log = getLogger(__name__) +from sat.core import exceptions from sat.tools import sat_defer @@ -102,6 +103,20 @@ class XEP_0060(object): else: client.pubsub_service = None + def getFeatures(self, profile): + try: + client = self.host.getClient(profile) + except exceptions.ProfileNotSetError: + return {} + try: + return {'service': client.pubsub_service.full() if client.pubsub_service is not None else ''} + except AttributeError: + if self.host.isConnected(profile): + log.debug("Profile is not connected, service is not checked yet") + else: + log.error("Service should be available !") + return {} + def parseExtra(self, extra): """Parse extra dictionnary