def info_query(self, elem):
        if not self.authJID:
            return self.stream_error('not-authorized')

        kind = elem.get('type')
        if kind == 'error':
            log.exception('Unhandled stanza error %r.', xml.tostring(elem))
            return

        if kind == 'result':
            name = self.iq_ident(elem)
        else:
            child = xml.child(elem)
            if child is None:
                log.exception('No child element: %r.' % xml.tostring(elem))
                return self.stanza_error(
                    elem, 'modify', 'not-acceptable',
                    'GET or SET must have a child element.'
                )
            name = '{jabber:client}iq/%s' % child.tag

        try:
            self.state.trigger_stanza(name, elem)
        except i.StreamError as exc:
            log.debug(
                'Caught StreamError while dispatching %r.', name,
                exc_info=True
            )
            self.stanza_error(elem, 'cancel', 'feature-not-implemented')
dataset/ETHPy150Open HenryHu/pybbs/xmpp/core.py/Core.info_query/original