def dispatch(self, xs, stanza):
        stanzaFrom = stanza.getAttribute('from')
        stanzaTo = stanza.getAttribute('to')

        if not stanzaFrom or not stanzaTo:
            xs.sendStreamError(error.StreamError('improper-addressing'))
        else:
            try:
                sender = jid.internJID(stanzaFrom)
                jid.internJID(stanzaTo)
            except jid.InvalidFormat:
                log.msg("Dropping error stanza with malformed JID")

            if sender.host != xs.otherEntity.host:
                xs.sendStreamError(error.StreamError('invalid-from'))
            else:
                self.xmlstream.send(stanza)
Decorator for deprecated functions.
dataset/ETHPy150Open ralphm/wokkel/wokkel/server.py/ServerService.dispatch--crossover with--dataset/ETHPy150Open smsapi/smsapi-python-client/smsapi/decorators.py/deprecated