Skip to content
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

Deleting messages in a thread #480

Open
FR31NDSDEV opened this issue Aug 15, 2023 · 0 comments
Open

Deleting messages in a thread #480

FR31NDSDEV opened this issue Aug 15, 2023 · 0 comments

Comments

@FR31NDSDEV
Copy link

FR31NDSDEV commented Aug 15, 2023

Say there's a thread:

Message 1
Message 2
Message 3
Message 4

For example if Message 3 is deleted / moved to trash, Message 4 is also deleted.
Same for message 2, it would be understandable if this occurred in the parent message which is Message 1, but it's also the case for any message in the thread.

Here's what I tried doing:

public function deleteEmail($folder, $uid, $nextUid)
    {
        $message = $this->findMessageByUid($folder, $uid);
        $nextMessage = $this->findMessageByUid($folder, $nextUid);
        if($nextMessage){
        $nextMessage->in_reply_to = $message->in_reply_to;
         }

        $message->move('INBOX.Trash');
    }

Although this solution would cause a lot of problems when trying to restore the deleted email, but I didn't find any other way.
If anyone has an insight on this, please enlighten me.

Edit: I also tried using $message->delete($expunge = true) but it produced the same output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant