def info_query(self, elem): # Same as in xmpp.Core, slight change in handling 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 ret = operation.handleOperation(self.events, elem) #TODO: Handle errors if ret != None: self.iq('result', ret)
def info_query(self, elem): # Same as in xmpp.Core, slight change in handling 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 ret = operation.handleOperation(self.events, elem) #TODO: Handle errors if ret != None: self.iq('result', ret)
def handle_stanza(self, el): super(WaveProtocol, self).handle_stanza(el) operation.handleOperation(self.events, el)