Closed Bug 700899 Opened 9 years ago Closed 9 years ago

Port |Bug 193281 - Ability to import/save e-mail messages from .eml text files to folders (Message|Copy)|

Categories

(SeaMonkey :: MailNews: Message Display, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
seamonkey2.8

People

(Reporter: squib, Assigned: InvisibleSmiley)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

+++ This bug was initially created as a clone of Bug #193281 +++

Mozilla can easily save selected messages to .eml text file. But there is no way
to perform opposite operation, i.e. import e-mail messages from .eml file. 
Such operation would be especially useful for transporting e-mail messages from
different Mozilla installations...



This bug is about porting the patch from bug 193281 to Seamonkey.
Hmm. First we need to port .isDummy. Which bug is this from?
That's from bug 474701, specifically attachment 382997 [details] [diff] [review]. I doubt you'll want that exact code, but you can probably look at the places where isDummy was added and figure out a good way to detect when you have a dummy message header.
I think we can add something like this to folderDisplay.js in accordance with messageWindow.js's MessageWindowController.supportsCommand:

get isDummy()
{
  return gDBView && gDBView.keyForFirstSelectedMessage == nsMsgKey_None;
}

[I just found that the above mentioned supportsCommand method is the reason why View Source is disabled for .eml messages and that TB uses gFolderDisplay.isDummy in the equivalent method, that's why.]

Philip, will you do this or shall I give it a try?
> Philip, will you do this or shall I give it a try?
By all means give it a go. I have other bugs I am currently looking into.
Assignee: nobody → jh
Status: NEW → ASSIGNED
Attachment #573916 - Flags: review?(mnyromyr)
Summary: Ability to import/save e-mail messages from .eml text files to folders (Message|Copy) → Port |Bug 193281 - Ability to import/save e-mail messages from .eml text files to folders (Message|Copy)|
Version: unspecified → Trunk
Comment on attachment 573916 [details] [diff] [review]
patch [Checkin: comment 7]

Cool feature work!

Just the usual nits. ;-)

>   if(copyMenu)
>-      copyMenu.setAttribute("disabled", !aMessage);
>+      copyMenu.setAttribute("disabled", !canCopy);

Good opportunity to fixup the if as well.

>+    if (gMessageDisplay.isDummy) {
>+      let file = window.arguments[0].QueryInterface(Components.interfaces
>+                                                              .nsIFileURL).file;

No need for an artifical wrap here, imo.

>+    } else {
>+      gDBView.doCommandWithFolder(nsMsgViewCommandType.copyMessages, destMsgFolder);
>+    }
>   }

Please format the new stuff as brace-on-its-own-line (despite the rest of the function still being broken).

r/moa=me with that.
Attachment #573916 - Flags: superreview+
Attachment #573916 - Flags: review?(mnyromyr)
Attachment #573916 - Flags: review+
Comment on attachment 573916 [details] [diff] [review]
patch [Checkin: comment 7]

http://hg.mozilla.org/comm-central/rev/3ab8b701b57e
with nits addressed
Attachment #573916 - Attachment description: patch → patch [Checkin: comment 7]
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → seamonkey2.8
Blocks: 738163
You need to log in before you can comment on or make changes to this bug.