@xmpp.iq('{%s}query' % __disco_info_ns__)
    def disco_info(self, iq):
        """ Service Discovery: disco#info """

        target = iq.get('to')

        if (target.find('@') < 0):
            # query server info
            query = self.E.query({ 'xmlns': __disco_info_ns__},
                self.E.identity({ 'category': 'server',
                                 'type': 'im',
                                 'name': Config.Config.GetString('XMPP_SERVER_IDENTITY_NAME', 'BBS'),
                                }))
            features = [__disco_info_ns__, __disco_items_ns__, __vcard_ns__]
            for feature in features:
                query.append(self.E.feature({'var' : feature}))

        else:
            # query client info
            query = self.E.query({ 'xmlns': __disco_info_ns__},
                self.E.identity({ 'category': 'client',
                                 'type': 'term',
                                 'name': Config.Config.GetString('XMPP_SERVER_IDENTITY_NAME', 'BBS'),
                                }))

            features = [__disco_info_ns__, __disco_items_ns__, __vcard_ns__]
            for feature in features:
                query.append(self.E.feature({'var' : feature}))

        return self.iq('result', iq, query, {'from': target})
dataset/ETHPy150Open HenryHu/pybbs/xmppserver.py/XMPPServer.disco_info/original