Changed join on invite logic and added debug print. Fixes #5 (hopefully).

This commit is contained in:
Ville Ranki 2019-12-29 17:26:47 +02:00
parent f93069fc4b
commit 73084a15f9
1 changed files with 11 additions and 11 deletions

6
bot.py
View File

@ -117,9 +117,7 @@ class Bot:
traceback.print_exc(file=sys.stderr)
async def invite_cb(self, room, event):
if not self.join_on_invite or self.is_owner(event):
return
if self.join_on_invite or self.is_owner(event):
for attempt in range(3):
result = await self.client.join(room.room_id)
if type(result) == JoinError:
@ -128,6 +126,8 @@ class Bot:
)
else:
break
else:
print('Received invite event, but not joining as sender is not owner or bot not configured to join on invte.')
def load_module(self, modulename):
try: