Closed
Bug 128916
Opened 23 years ago
Closed 21 years ago
Need new method to the view's js interface that returns header flags from a URI
Categories
(MailNews Core :: Backend, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: ssu0262, Assigned: ssu0262)
References
(Blocks 1 open bug)
Details
(Keywords: regression)
Attachments
(1 file)
1.30 KB,
patch
|
Details | Diff | Splinter Review |
I'm not sure if I got the summary correct, but here is the problem: The patch to bug 82056 will conflict with the patch in bug 30560 in that when right-mouse clicking on an already deleted message (that is not currently selected) to undelete, the context menu item should display 'Undelete Message'. It will show 'Delete Message' still. The reason being is that the only view method that returns the header for a selected message (hdrForFirstSelectedMessage()), returns the message that is reference by the outliner's 'currentIndex' which is not necessarily the same as the message that is currently selected/highlighted (specially after fixing bug 30560). The header is required to check for the MSG_FLAG_IMAP_DELETED flag and show the appropriate context menu string. One solution is to add a new method to expose the GetMsgDBHdrFromURI() function in js, since there's already way in js to get the correct URI of the selected message.
Comment 1•22 years ago
|
||
In fact there is a way to get the hdr for a URI, I found some code in the extractMsgKeyFromURI function, the code would look something like this, thus making it independent of the patch to bug 30560. How does it look? function UpdateDeleteCommand() { var value = "value"; var uri = GetFirstSelectedMessage(); if (IsNewsMessage(uri)) value += "News"; else if (IsIMAPDeleted(uri)) value += "IMAPDeleted"; if (GetNumSelectedMessages() < 2) value += "Message"; else value += "Messages"; goSetMenuValue("cmd_delete", value); goSetAccessKey("cmd_delete", value + "AccessKey"); } function IsImapDeleted(uri) { if (uri) { var msgService = messenger.messageServiceFromURI(uri); if (msgService) { var msgHdr = msgService.messageURIToMsgHdr(uri); if (msgHdr) return msgHdr.flags & MSG_FLAG_IMAP_DELETED; } } return 0; }
Neil, that actually looks good. Can you attach a working patch?
Comment 3•22 years ago
|
||
Updated•22 years ago
|
Comment 4•22 years ago
|
||
Tested Neil's patch with IMAP (and POP) on nightly 2002032003, "delete" and "undelete" are now always shown as appropriate in the context menu.
I can't verify his patch. It wasn't working for me, but then I have lots of other things going on in my current tree. If you can't find someone else to r=, I'll do it as soon as I can pull a fresh tree. Sorry for the inconvenience, but I'm currently at home recovering from a surgery, and I don't have a high speed connection to the internet from home.
Comment 6•22 years ago
|
||
*** Bug 148261 has been marked as a duplicate of this bug. ***
Comment 7•21 years ago
|
||
Fixed by checkin to bug 161333.
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Updated•20 years ago
|
Product: MailNews → Core
Updated•16 years ago
|
Product: Core → MailNews Core
You need to log in
before you can comment on or make changes to this bug.
Description
•