Closed Bug 34074 Opened 24 years ago Closed 23 years ago

Pop3 - Needs to reselect the previously selected message after compacting the folder

Categories

(SeaMonkey :: MailNews: Message Display, defect, P3)

x86
Windows NT
defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: jefft, Assigned: naving)

References

Details

Attachments

(5 files)

We need to reselect the folder and previous selected message after compacting 
the pop3 folder.
QA Contact: lchiang → laurel
reassign to Jeff - he knows the issues best.
Assignee: selmer → jefft
Status: NEW → ASSIGNED
Target Milestone: --- → M16
Not beta2 stopper, marking M18.  Please add beta2 keyword if you disagree.
Target Milestone: M16 → M18
reassigning jefft's bugs to naving
Assignee: jefft → naving
Status: ASSIGNED → NEW
*** Bug 69728 has been marked as a duplicate of this bug. ***
Target Milestone: M18 → ---
*** Bug 60487 has been marked as a duplicate of this bug. ***
*** Bug 92008 has been marked as a duplicate of this bug. ***
Attached patch proposed fix.Splinter Review
The fix is to save the first selected message before doing compact and 
then after the compact is over; if the folder is the open then reroot the
folder and restore the selection of the message. Note this is needed 
only for local folders so I have added mCompactCompletedAtom to local 
folder only and the notification is also only for local folder. 
Attached patch proposed fix, v2Splinter Review
The new patch makes it work for cases not covered before. david, please review.
this seems needlessly complicated. Isn't there a way to avoid changing all the
GetDatabase calls? What I expected to see was js code checking if the currently
loaded folder was the one that was just compacted (in the notification handler)
and in that case, do the reroot. The code used to work this way - just checking
against the currently loaded folder.

Also, to get the first selected view index, couldn't you just call 
mOutlinerSelection->GetCurrentIndex(&currentIndex); ? That gives you what the
focused message is.
Well there are so many cases to handle

Compact this folder (one folder)
1) can / can't be compacted

these cases are handled in widgetglue.js

Compact All folders
1)currently selected folder can be compacted
2)currently selected folder can't be compacted

In this case there will be no notification from the backend because we 
are not doing anything to the currently selected folder

Auto-compact folders
In this case we initiate the compact all for local folders from backend. 
so I had to rely on the msgWindow.openFolder to tell us if this is the 
folder that is selected on the front end. 

Regarding the GetDatabase() calls we should not fire the folderLoaded event 
because it does a bunch of things like msgFolder.endFolderLoading() and 
other stuff in js that is not needed for compact.

For first selected msg index I will make the change. 
I'm still confused - you can have 10 pop servers with local folders underneath
them, and imap filters can move messages to any of the folders under those pop
servers, can't they? Those are not servers of type none.

Re not firing folder loaded notification, I think it would be better to just
ignore the folder loaded notification, instead of not sending it.
Attached patch proposed fix, v3Splinter Review
So this version v3, is just as you noted in the comment above. 
Blocks: 92056
Attached patch complete fix!!Splinter Review
Ok, this looks very good, except for one thing - does it work in the case of
having a multiple selection? I.e., if you select one message, and then extend
the selection, do we still reload the correct message? I think the correct way
to actually figure out which message to reload is to find the view index of
nsMsgDBView::m_currentlyDisplayedMsgKey and not to try to deduce it from the
selection.
Attached patch revised patchSplinter Review
r=cavin.
fix checked in. 
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
QA Contact: laurel → sheelar
*** Bug 94288 has been marked as a duplicate of this bug. ***
verified after compaction the previous message is remembered and gets selected 
in the thread pane and loaded in the message pane.  I also checked having 
selected more than one message in the thread pane that after compaction it 
remembers to load the correct message that was loaded before compaction. 
Tested this with both compact this folder and compact all folders.  
Compaction initiated by the preference does not load the message pane but the 
thread pane is loaded with previous selection and is not blank like before. 
Checked with Navin and he said since this is initiated in the backend that this 
was the expected result.

builds:
2001-08-15-06 win98, linux
2001-08-17-04 mac 

Status: RESOLVED → VERIFIED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: