-
-
Notifications
You must be signed in to change notification settings - Fork 34
Description
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