diff --git a/moodle_dl/notifications/xmpp/xmpp_shooter.py b/moodle_dl/notifications/xmpp/xmpp_shooter.py index ff2bc2c6..e0334d0d 100644 --- a/moodle_dl/notifications/xmpp/xmpp_shooter.py +++ b/moodle_dl/notifications/xmpp/xmpp_shooter.py @@ -15,6 +15,8 @@ def send(self, message): if not self.is_connected: self.connection.connect() self.connection.auth(user=self.jid.getNode(), password=self.password, resource=self.jid.getResource()) + if not hasattr(self.connection, 'Bind') or getattr(self.connection, 'Bind').session != 1: + raise ConnectionError('XMPP Session could not be opend') self.is_connected = True self.connection.send(xmpp.protocol.Message(to=self.recipient, body=message))