Skip to content

Commit

Permalink
send error if someone wasn't added to admin group correctly. fixes #68
Browse files Browse the repository at this point in the history
  • Loading branch information
missytake committed Jan 20, 2023
1 parent fde5115 commit f690865
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/mailadm/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@ def is_admin_group_message(self, command: deltachat.Message):
else:
logging.info("%s is not allowed to give commands to mailadm.",
command.get_sender_contact())
elif command.chat.is_protected() and not command.is_encrypted():
sender = command.get_sender_contact().addr
logging.warning("The bot doesn't trust %s, please re-add them to admin group" %
(sender,))
command.chat.send_text("I didn't see %s being added to this group - can someone who"
" verified them re-add them?" % (sender,))
raise ValueError
else:
logging.info("The admin group is broken. Try `mailadm setup-bot`. Group ID: %s",
str(self.admingrpid))
Expand Down

0 comments on commit f690865

Please sign in to comment.