summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2016-12-07 19:06:25 +0100
committermathieui <mathieui@mathieui.net>2016-12-07 19:06:25 +0100
commitffd9436e5cca9f92ed11683173a696972da2360b (patch)
tree3908ce78f8ab17781b1a5d8144772635088aa041
parentbbb1344d79d801837517af9a25c3ea2306c1604d (diff)
downloadslixmpp-ffd9436e5cca9f92ed11683173a696972da2360b.tar.gz
slixmpp-ffd9436e5cca9f92ed11683173a696972da2360b.tar.bz2
slixmpp-ffd9436e5cca9f92ed11683173a696972da2360b.tar.xz
slixmpp-ffd9436e5cca9f92ed11683173a696972da2360b.zip
Fix roster push origin detection and tests
-rw-r--r--slixmpp/clientxmpp.py9
1 files changed, 8 insertions, 1 deletions
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(