Skip to content

Commit

Permalink
Fix Xmpp login check
Browse files Browse the repository at this point in the history
  • Loading branch information
C0D3D3V committed Apr 26, 2023
1 parent 3781499 commit 20bbfc2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions moodle_dl/notifications/xmpp/xmpp_shooter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

0 comments on commit 20bbfc2

Please sign in to comment.