The default bug view has changed. See this FAQ.

drag & drop an .eml file into a mailbox folder

RESOLVED FIXED in seamonkey2.0b2

Status

SeaMonkey
MailNews: Message Display
--
enhancement
RESOLVED FIXED
8 years ago
8 years ago

People

(Reporter: Phil Lacy, Assigned: Phil Lacy)

Tracking

unspecified
seamonkey2.0b2
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 3 obsolete attachments)

(Assignee)

Description

8 years ago
+++ This bug was initially created as a clone of Bug #171907 +++

Once I saved an email as eml-file and deleted it from my mail folders, I cannot
get it into a mail folder again.
This could be useful e.g. to create a reply, or to "edit message as new".

Workaround: drag & drop it to Outlook Express, then Tools->Import... from there.

I am using 1.1 on Windows 2000. Does this work on Linux?
(Assignee)

Comment 1

8 years ago
Created attachment 384570 [details] [diff] [review]
drag and drop external files to a folder in mail part of seamonkey

Seamonkey is a little different.
this worked for my quick install of seamonkey but I'm not that familiar with it.
It works with copying local store and didn't break multiple messages dnd. But not tested to see if it broke rss feeds dnd and dnd to imap or dnd of folders.
Attachment #384570 - Flags: review?(mkmelin+mozilla)

Comment 2

8 years ago
Comment on attachment 384570 [details] [diff] [review]
drag and drop external files to a folder in mail part of seamonkey

Passing this to Karsten (i'm not a mailnews/ reviewer)
Attachment #384570 - Flags: review?(mkmelin+mozilla) → review?(mnyromyr)

Comment 3

8 years ago
Comment on attachment 384570 [details] [diff] [review]
drag and drop external files to a folder in mail part of seamonkey

Works even under Linux. ;-)

Just some nits:

>diff --git a/mailnews/base/resources/content/messengerdnd.js b/mailnews/base/resources/content/messengerdnd.js
>     trans.addDataFlavor("text/x-moz-newsfolder");
>+    trans.addDataFlavor("application/x-moz-file");

This MIME type looks odd. It does neither an official one nor does it follow the internal Mozilla scheme of text/x-moz-*, so where do you get it?
You should use the official "message/rfc822" type.

>@@ -83,16 +84,28 @@ function CanDropOnFolderTree(index, orie
>+          dataObj = dataObj.value.QueryInterface(Components.interfaces.nsILocalFile);
>+          if (!dataObj)
>+            return false;
>+          return dataObj.isFile();

You can just use

if (dataObj && dataObj.value instanceof Components.interfaces.nsILocalFile)
  return dataObj.isFile();
return false;

here.

>+    var dropFile = false;

What's the use of this variable? It's only set twice and never used.

>+        // shortcircuit external files and get out
>+        if (flavor.value == "application/x-moz-file") {

You should put the { (here and below) on their own lines for consistency reasons.

>+          dropFile = true;
>+          if (dataObj)
>+            dataObj = dataObj.value.QueryInterface(Components.interfaces.nsILocalFile);
>+          if (!dataObj)
>+            return false; // don't know how this would ever happen
>+          if (dataObj.isFile()) {
>+            let len = dataObj.leafName.length;
>+            if (len > 4 && dataObj.leafName.substr(len-4).toLowerCase() == ".eml")

Need spaces around the subtraction operator.

>+            }

Wrong indent.

>     }
>-
>+    

Don't add superfluous whitespace.
Attachment #384570 - Flags: review?(mnyromyr) → review-
(Assignee)

Comment 4

8 years ago
Created attachment 387371 [details] [diff] [review]
per review comments + changed to more appropriate, nsIFile

http://mxr.mozilla.org/comm-central/source/mozilla/widget/public/nsITransferable.idl#57

the lost var dropFile was holdover from different approach.

above link shows our transfer flavor for files. Although it's a local file the transferable indicates nsIFile so I changed to that interface.
Attachment #384570 - Attachment is obsolete: true
Attachment #387371 - Flags: review?(mnyromyr)

Updated

8 years ago
Attachment #387371 - Flags: review?(mnyromyr) → review+

Comment 5

8 years ago
Comment on attachment 387371 [details] [diff] [review]
per review comments + changed to more appropriate, nsIFile

> above link shows our transfer flavor for files.

Yeah, sorry, I only realized after commenting. :-|
(Assignee)

Updated

8 years ago
Keywords: checkin-needed

Comment 6

8 years ago
Comment on attachment 387371 [details] [diff] [review]
per review comments + changed to more appropriate, nsIFile

You need SR on shared code in /mailnews.
Attachment #387371 - Flags: superreview?(bienvenu)

Updated

8 years ago
Keywords: checkin-needed
(Assignee)

Comment 7

8 years ago
Created attachment 389419 [details] [diff] [review]
forbid drop on rss feed folders

added a 'no drop' if on rss feed folder.
Also, var cs was moved but I copied it to its new location instead of moving.
Attachment #387371 - Attachment is obsolete: true
Attachment #389419 - Flags: review?(mnyromyr)
Attachment #387371 - Flags: superreview?(bienvenu)

Updated

8 years ago
Attachment #389419 - Flags: review?(mnyromyr) → review+
(Assignee)

Updated

8 years ago
Attachment #389419 - Flags: superreview?(bienvenu)

Updated

8 years ago
Status: NEW → ASSIGNED

Comment 8

8 years ago
Why would we disable drop on rss feed folders? They're just local folders, and they can have messages added to them if the user wants...or does drag drop not work onto them?
(Assignee)

Comment 9

8 years ago
bug 505116 Thunderbird, Magnus was thinking the same thing.

This patch needs to have file drop to rss reenabled.
(Assignee)

Comment 10

8 years ago
Comment on attachment 389419 [details] [diff] [review]
forbid drop on rss feed folders

I'll revise it to allow drop in rss folders
Attachment #389419 - Flags: superreview?(bienvenu)
(Assignee)

Comment 11

8 years ago
Created attachment 393111 [details] [diff] [review]
drop on rss folder is ok
Attachment #389419 - Attachment is obsolete: true
Attachment #393111 - Flags: superreview?(bienvenu)
(Assignee)

Updated

8 years ago
Depends on: 500917
(Assignee)

Updated

8 years ago
Blocks: 500917
No longer depends on: 500917

Updated

8 years ago
Attachment #393111 - Flags: superreview?(bienvenu) → superreview+
(Assignee)

Updated

8 years ago
Keywords: checkin-needed
Pushed: http://hg.mozilla.org/comm-central/rev/7cd1d18a9c46
Status: ASSIGNED → RESOLVED
Last Resolved: 8 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → seamonkey2.0b2
You need to log in before you can comment on or make changes to this bug.