-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: send error if someone wasn't added to admin group correctly. #99
Conversation
c62dc2b
to
c70709b
Compare
c70709b
to
77f1ffa
Compare
src/mailadm/bot.py
Outdated
sender = message.get_sender_contact().addr | ||
logging.warning("The bot doesn't trust %s, please re-add them to admin group" % | ||
(sender,)) | ||
message.chat.send_text("I didn't see %s being added to this group - can someone who" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this really work? I guess in this case you will not be able to send the message, because the group is protected and you don't have a verified key for one of the members.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True. I'll think of something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I decided to create a new unverified group to tell the admin group members that the admin group is broken.
I also mitigated one corner case in which this can lead to an AttributeError (if someone in the group quote-replies to the group creation message, because then the bot thinks it's a support group).
I don't like this solution very much; it basically adds one more chat type which the bot needs to handle, thereby further increasing complexity. Maybe just leaving the recovery group directly after creating it would be better, what do you think?
@@ -62,7 +62,15 @@ def ac_incoming_message(self, message: deltachat.Message): | |||
logging.debug("ignoring message, it's just admins discussing in a support group") | |||
else: | |||
chat = message.create_chat() | |||
if chat.is_group(): | |||
if chat.is_protected() and not message.is_encrypted(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can mean any of:
- The message was not encrypted, probably sent with a classic MUA
- The message was signed with a different key, probably because we verified the contact earlier, then the contact changed the key. It could be that nobody verified the contact yet. We can still write into the group.
- The contact is not a member of the group. We cannot write to the group and need a recovery group.
Closing as stale. |
closes #68
supercedes #95