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

Feature request - New retention policy: Always keep unread messages #324

Open
MonoS opened this issue Jul 18, 2024 · 10 comments
Open

Feature request - New retention policy: Always keep unread messages #324

MonoS opened this issue Jul 18, 2024 · 10 comments
Labels
enhancement New feature or request Funding needed

Comments

@MonoS
Copy link

MonoS commented Jul 18, 2024

As the title says, a new retention policy option to not delete unread message.
I've already checked inside the codebase, downloaded here https://hg.mozilla.org/comm-central/archive/tip.zip , so here some pointers:

  • \mailnews\base\content\folderProps.xhtml and \mailnews\base\prefs\content\am-offline.xhtml
    Here a new checkbox should be added after the "retention.applyToFlagged" element's hbox

  • \mailnews\base\content\retention.js
    Here initCommonRetentionSettings and saveCommonRetentionSettings should be modified to get/set the new option

  • \mailnews\base\prefs\content\am-offline.js
    Here in onLockPreference the new option should be added, in onPreInit the option should be set to hidden like the "retention.applyToFlagged" option

  • \mailnews\db\msgdb\public\nsMsgDatabase.h
    Here a new boolean protected attribute should be add to structure nsMsgRetentionSettings

  • \mailnews\db\msgdb\public\nsIMsgDatabase.idl
    I don't know if this file is autogenerated, but if it's not the new attribute should be added at the end of interface nsIMsgRetentionSettings

  • \mailnews\base\src\nsMsgIncomingServer.cpp
    Here method nsMsgIncomingServer::SetRetentionSettings and nsMsgIncomingServer::GetRetentionSettings should be modified to use the new attribute

  • \mailnews\db\msgdb\src\nsMsgDatabase.cpp
    Here the constructor should be changed to set a default value to the new member attribute, also setter and getter should be created like the ones for m_applyToFlaggedMessages, then method nsMsgDatabase::SetMsgRetentionSettings and nsMsgDatabase::GetMsgRetentionSettings should be modified to use the new attribute. After that method signature of nsMsgDatabase::FindMessagesOlderThan and nsMsgDatabase::FindExcessMessages should be changed to include the new parameter after applyToFlaggedMessages, then, after the code that skip the message if is nsMsgMessageFlags::Marked, a new check should be implemented, like the one for Marked, to check flag nsMsgMessageFlags::Read. In the end method nsMsgDatabase::ApplyRetentionSettings should call the new getter and pass the new flag to the other two method.

From my research that should be all, i hope to not have missed something

@Betterbird
Copy link
Owner

Betterbird commented Jul 18, 2024 via email

@MonoS
Copy link
Author

MonoS commented Jul 18, 2024

Because i didn't know it existed, i've downloaded the code and searched with np++ so I guess is kind of the same thing? maybe i've searched the latest commit instead of a specific version

@Betterbird
Copy link
Owner

Betterbird commented Jul 18, 2024 via email

@MonoS
Copy link
Author

MonoS commented Jul 18, 2024

Oh, nice, i'll recheck everything with it and edit my post with new finding then, thanks.

@Betterbird
Copy link
Owner

From my research that should be all, i hope to not have missed something

It would be easier if you submitted a patch. Looks like you also need to add some strings for the UI. BTW, IDL files define interfaces, they are not auto-generated, but include files are generated from them.

@MonoS
Copy link
Author

MonoS commented Jul 19, 2024

It would be easier if you submitted a patch

I could do that, i just hope I won't struggle with the build system like all the time :)

@Betterbird
Copy link
Owner

Depending on your OS, the one-liner ./build.sh 128 might just work. README.md has a bit of information. Also, you don't necessarily need to build it. Just make the code changes you described and submit a patch.

@MonoS
Copy link
Author

MonoS commented Jul 19, 2024

Depending on your OS, the one-liner ./build.sh 128 might just work.

Well, what i'm most interested in is downloading the correct version, would this download the correct version i should diff to? BTW i'm on windows.

@Betterbird
Copy link
Owner

You should follow https://github.com/Betterbird/thunderbird-patches/blob/main/README.md for Windows.

At the end you can issue ./build.sh 128 apply. That just makes the source code ready without compiling it.

@Betterbird
Copy link
Owner

If you don't want to build, you can just download the comm-central or comm-esr128 repository. That's much smaller than the Mozilla repository which you need to build.

@Betterbird Betterbird added enhancement New feature or request Funding needed labels Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Funding needed
Projects
None yet
Development

No branches or pull requests

2 participants