summaryrefslogtreecommitdiff
path: root/src/connection.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/connection.py')
-rw-r--r--src/connection.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/connection.py b/src/connection.py
index 7871c45d..8faf0125 100644
--- a/src/connection.py
+++ b/src/connection.py
@@ -31,7 +31,7 @@ import xmpp
from config import config
from logging import logger
from handler import Handler
-from common import jid_get_node, jid_get_domain, is_jid_the_same, exception_handler
+from common import jid_get_node, jid_get_domain, is_jid_the_same
class Connection(threading.Thread):
"""
@@ -142,6 +142,9 @@ class Connection(threading.Thread):
"""
fro = presence.getFrom()
toj = presence.getAttr('to')
+ if presence.getType() == 'error':
+ self.error_message(presence)
+ return
if fro == toj: # own presence
self.online = 2
self.jid = toj
@@ -153,9 +156,6 @@ class Connection(threading.Thread):
"""
if not connection:
return
- if presence.getType() == 'error':
- self.error_message(presence)
- return
self.handler.emit('room-presence', stanza=presence)
raise xmpp.protocol.NodeProcessed