Conversation
link2xt
reviewed
Nov 30, 2024
| ChatIdBlocked::lookup_by_contact(self, contact_id) | ||
| // Use `Request` so that even if the program crashes, the user doesn't have to look | ||
| // into the blocked contacts. | ||
| ChatIdBlocked::get_for_contact(self, contact_id, Blocked::Request) |
Collaborator
There was a problem hiding this comment.
Maybe create the chat with Blocked::Not or Blocked::Yes already based on SyncAction? And if it is not Block or Unblock, then Blocked::Request.
Collaborator
Author
There was a problem hiding this comment.
For a 1:1 chat possible actions are Block, Accept, SetVisibility, SetMuted, Rename and even Unblock if Block was missed somehow before e.g. the synchronization was disabled. I don't think it's worth complicating the logic adding one more match here. Blocked::Request reflects what happens on the first device (first the chat is created and only then the user does smth), i think this is fine even if we crash/fail and don't finish the job.
…rom contact (#6259) A sync message for accepting or blocking a 1:1 chat may arrive before the first message from the contact, when it does not exist yet. This frequently happens in non-chatmail accounts that have moving to the DeltaChat folder disabled because Delta Chat unconditionally uploads sync messages to the DeltaChat folder. Let's create a hidden contact in this case and a 1:1 chat for it.
b2f5c55 to
b5b8f5d
Compare
link2xt
approved these changes
Dec 1, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #6259