Created attachment 704299
Test extention : Change arbitary IMAP folder to trashFolderName folder and SpecialUse=Trash folder by ToolBar button click
This test extension is for seeing Tb's behavior on "trash", and merely does following when customized ToolBar button-1 is clicked.
(1) Puts currently selected folder name to incomingServer.trashFolderName
if IMAP account. (call ABC/DEF for later reference)
(1-A) Use string in msgFolder.URI instead of msgFolder.prettiestName
for setting incomingServer.trashFolderName, in case of localized special
folder name by localized Tb.
(1-B) Remove personalNamespace from string set in msgFolder.prettiestName,
because Tb's current logic which uses mail.server.serverN.trash_folder_name
requests "Mbox name without namespace" in trash_folder_name setting.
Note: This test extension doesn't care about "IMAP server directory:" of Server Settings/Advanced.
By (1), Tb automatically updates mail.server.serverN.trash_folder_name and is automatically reflected to trash folder selection UI at Server Settings.
This works very well, as far as problem of bug 831664 is bypassed by operation like "write very long text to Error Console".
(2) Request msgFolder.setflag(Trash) for selected folder of ABC/DEF
and msgFolder.clearflag(Trash) for all other folders under the IMAP account.
(this is opposite action to DiscoveryDone().)
By (2), icon of selected folder of ABC/DEF is changed to trash-can-icon, and trash-can-icon is removed from any other folder including [Gmail]/[Trash] of Gmail IMAP.
Even when Gmail IMAP, folder of ABC/DEF is used by Tb as "trash for Tb" when IMAP delete model of "Move to trash" and mails are moved to ABC/DEF when delete is requested, until collapse/re-expand, subscribe, unsubscribe etc. is executed,
Test result of (1) indicates possible new/easy trash selection for user,
Context menu of "Use this folder as Trash".
although it's perhaps merely wasting of valuable context menu space.
Because this works only on existent folder, this way can do noting for "automatic folder creation of trash which is set in mail.server.serverN.trash_folder_name or default of it(==Trash)".
Because "trash for Tb" can be set by the test extension even when IMAP delete model of "Just mark it as deleted" or "Remove immediately", "Empty Trash after copy/move mail to [Gmail]/Trash for immediate/permanent removal of mails" is possible, even with "Just mark it as deleted" or "Remove immediately".
Because Tb currently doesn't change SpecialUse=Trash setting of any folder if "Just mark it as deleted" or "Remove immediately", this works even with Gmail IMAP and current Tb.
Created attachment 704299
Test extention : Change arbitary IMAP folder to trashFolderName folder and SpecialUse=Trash folder by ToolBar button click
This test extension is for seeing Tb's behavior on "trash", and merely does following when customized ToolBar button-1 is clicked.
(1) Puts currently selected folder name to incomingServer. trashFolderName prettiestName trashFolderName , in case of localized special prettiestName, serverN. trash_folder_ name
if IMAP account. (call ABC/DEF for later reference)
(1-A) Use string in msgFolder.URI instead of msgFolder.
for setting incomingServer.
folder name by localized Tb.
(1-B) Remove personalNamespace from string set in msgFolder.
because Tb's current logic which uses mail.server.
requests "Mbox name without namespace" in trash_folder_name setting.
Note: This test extension doesn't care about "IMAP server directory:" of Server Settings/Advanced.
By (1), Tb automatically updates mail.server. serverN. trash_folder_ name and is automatically reflected to trash folder selection UI at Server Settings.
This works very well, as far as problem of bug 831664 is bypassed by operation like "write very long text to Error Console".
(2) Request msgFolder. setflag( Trash) for selected folder of ABC/DEF clearflag( Trash) for all other folders under the IMAP account.
and msgFolder.
(this is opposite action to DiscoveryDone().)
By (2), icon of selected folder of ABC/DEF is changed to trash-can-icon, and trash-can-icon is removed from any other folder including [Gmail]/[Trash] of Gmail IMAP.
Even when Gmail IMAP, folder of ABC/DEF is used by Tb as "trash for Tb" when IMAP delete model of "Move to trash" and mails are moved to ABC/DEF when delete is requested, until collapse/re-expand, subscribe, unsubscribe etc. is executed,
When Gmail IMAP account is collapsed/ re-expanded, following is observed. mxr.mozilla. org/comm- central/ source/ mail/base/ content/ folderPane. js#881 server. performExpand( msgWindow) ; mxr.mozilla. org/comm- central/ source/ mailnews/ imap/src/ nsImapIncomingS erver.cpp# 941 erver:: PerformExpand( nsIMsgWindow *aMsgWindow) >DiscoverAllFol ders(rootMsgFol der, mxr.mozilla. org/comm- central/ source/ mailnews/ imap/src/ nsImapService. cpp#1811 :DiscoverAllFol ders(nsIMsgFold er *aImapMailFolder, Append( "/discoverallbo xes"); onAndLoadUrl( imapUrl, nullptr, aURL); mxr.mozilla. org/comm- central/ source/ mailnews/ imap/src/ nsImapIncomingS erver.cpp# 2331 erver:: OnStopRunningUr l(nsIURI *url, nsresult exitCode) :nsImapDiscover AllBoxesUrl: exitCode) )
Upon re-expand, trash-can-icon is removed from ABC/DEF,
and icon of [Gmail]/Trash is changed to trash-can-icon.
This is done by following.
> http://
> 881 if (aExpandServer) {
> 882 if (folder.isServer)
> 883 folder.
> http://
> 941 nsImapIncomingS
> 962 rv = imapService-
> http://
> 1811 NS_IMETHODIMP nsImapService:
> 1834 urlSpec.
> 1838 rv = GetImapConnecti
After completion of the discoverallboxes request,
> http://
> 2331 nsImapIncomingS
> 2350 case nsIImapUrl:
> 2351 if (NS_SUCCEEDED(
> 2352 DiscoveryDone();
Test result of (1) indicates possible new/easy trash selection for user, serverN. trash_folder_ name or default of it(==Trash)".
Context menu of "Use this folder as Trash".
although it's perhaps merely wasting of valuable context menu space.
Because this works only on existent folder, this way can do noting for "automatic folder creation of trash which is set in mail.server.
Because "trash for Tb" can be set by the test extension even when IMAP delete model of "Just mark it as deleted" or "Remove immediately", "Empty Trash after copy/move mail to [Gmail]/Trash for immediate/permanent removal of mails" is possible, even with "Just mark it as deleted" or "Remove immediately".
Because Tb currently doesn't change SpecialUse=Trash setting of any folder if "Just mark it as deleted" or "Remove immediately", this works even with Gmail IMAP and current Tb.