fmbiete / Z-Push-contrib

Z-Push fork with changes that I will try to contrib
GNU Affero General Public License v3.0
135 stars 62 forks source link

Feature Request - Mark as Read when Moving to Trash #166

Closed t3chguy closed 9 years ago

t3chguy commented 9 years ago

Roundcube Mail has a nice optional feature, which allows you to have all mail being put into Trash to be marked as Read. Any chance of you adding this to your imap backend and making it configurable in its respective config.php?

fmbiete commented 9 years ago

Hi @t3chguy ,

This shouldn't be too hard, so test with the referenced commit.

Regards,

t3chguy commented 9 years ago

Wow @fmbiete that was incredibly fast, thanks!

t3chguy commented 9 years ago

Well it didn't seem to work, I'll add some debug lines into the code and figure out what's going on. When I wake up that is, I'll post back here when I know something

gmta commented 9 years ago

I'm wondering whether this should be a part of the communication layer, because it's usually the client that determines this? Or do you know of cases where this is implemented in the backend?

The default in most email clients is to leave the 'read' flags alone when deleting messages. I would expect some confusion if someone sets this option by accident and tries to fix it in his or her email client.

t3chguy commented 9 years ago

@fmbiete, I'm wondering whether it doesn't work because its in the DeleteMessage method, the comment above it Called when the user has requested to delete (really delete) a message suggests that its not for messages being moved to trash, and instead for messages being deleted from trash, am I right in thinking that?

fmbiete commented 9 years ago

@GMTA Yes, it should be part of the client (roundcube, thunderbird offer it). But since the BackendIMAP is our client, that option should be offered there. Disabled by default, and the sysadmin should know what he is doing before enabling it.

@t3chguy Indeed. DeleteMessage is the real delete. MoveMessage will be called when deleting to Trash. Test with the last referenced commit.

t3chguy commented 9 years ago

I'll test it shortly, only thing I don't understand is why $move_to_trash is defined so early on, there's many ways for it to never get used, why doesn't it for instance get defined much later on?

t3chguy commented 9 years ago

The Commit works

fmbiete commented 9 years ago

Yeah, the variable can be defined just before use. :+1: Fixed!