-
Notifications
You must be signed in to change notification settings - Fork 96
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
feat: delete messages on IMAP when deleting chat #6613
Conversation
this improves deletion in case different client know different messages to delete. deletion is fast and it is not an issue to delete messages that are already deleted (this is even the most common case for chatmail)
Looks good, but if |
|
(delete_msgs_target, self,), | ||
)?; | ||
transaction.execute( | ||
"DELETE FROM smtp WHERE msg_id IN (SELECT id FROM msgs WHERE chat_id=?)", |
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 thought this might have weird consequences in large groups. If the message is split into multiple SMTP messages, then second device might receive a message and then delete the chat. Then first device will remove the message from SMTP queue and stop sending the rest of the copies.
But all is fine: we always place bcc-self copy as the last copy into smtp
queue.
Generally, yes, but sometimes i disable |
this PR deletes all known messages belonging to a chat when the chat is deleted.
this may not be an exhaustive list as a client might not know all message-ids (eg. when using different times for "delete from device"). in this case, other devices may know more IDs. otherwise, the chatmail server will eventually clean up at some point. for non-chatmail, this is up to the user then.
the deletion sql commands were inspired by
delete_msgs_ex
(in fact, a first try was adapting that part, however, that seems less performant as lots of sql commands are needed)successor of #5007