

def onElement(self, element):
    "\n        Called on incoming XML Stanzas.\n\n        The very first element received should be a request for handshake.\n        Otherwise, the stream is dropped with a 'not-authorized' error. If a\n        handshake request was received, the hash is extracted and passed to\n        L{onHandshake}.\n        "
    if ((element.uri, element.name) == (self.namespace, 'handshake')):
        self.onHandshake(unicode(element))
    else:
        exc = error.StreamError('not-authorized')
        self.xmlstream.sendStreamError(exc)

dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/words/protocols/jabber/component.py ListenComponentAuthenticator.onElement/original