From ffd9436e5cca9f92ed11683173a696972da2360b Mon Sep 17 00:00:00 2001 From: mathieui Date: Wed, 7 Dec 2016 19:06:25 +0100 Subject: Fix roster push origin detection and tests --- slixmpp/clientxmpp.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/slixmpp/clientxmpp.py b/slixmpp/clientxmpp.py index a57546f3..dd018fa2 100644 --- a/slixmpp/clientxmpp.py +++ b/slixmpp/clientxmpp.py @@ -15,6 +15,7 @@ import asyncio import logging +from slixmpp.jid import JID from slixmpp.stanza import StreamFeatures from slixmpp.basexmpp import BaseXMPP from slixmpp.exceptions import XMPPError @@ -110,7 +111,13 @@ class ClientXMPP(BaseXMPP): self._handle_stream_features)) def roster_push_filter(iq): from_ = iq['from'] - if from_ and from_ != self.boundjid.bare: + if from_ and from_ != JID('') and from_ != self.boundjid.bare: + reply = iq.reply() + reply['type'] = 'error' + reply['error']['type'] = 'cancel' + reply['error']['code'] = 503 + reply['error']['condition'] = 'service-unavailable' + reply.send() return self.event('roster_update', iq) self.register_handler( -- cgit v1.2.3