Port |Bug 662087 - Adding attachments via the command-line doesn't record their size| to SeaMonkey

RESOLVED FIXED in seamonkey2.4

Status

defect
RESOLVED FIXED
8 years ago
8 years ago

People

(Reporter: iann_bugzilla, Assigned: iann_bugzilla)

Tracking

(Blocks 1 bug)

Trunk
seamonkey2.4
Dependency tree / graph
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 3 obsolete attachments)

Posted patch Size cmdline attachments (obsolete) — Splinter Review
When adding attachments from the command-line the file size for the attachment isn't show.

This ports the TB fix.
Attachment #537923 - Flags: review?(neil)
Comment on attachment 537923 [details] [diff] [review]
Size cmdline attachments

This fails if the passed-in path is invalid or is not a file. (Previously the compose window would open with an invalid attachment and you would find out later when you tried to save or send the message.) Since this is the command line we need to be able to cope with potentially dodgy data.
Attachment #537923 - Flags: review?(neil) → review-
Changes since last version:
* Uses commandLine's resolveURI functionality to process attachment list.
* Adds new error message for when file specified in attachment is missing.
* Encodes web uris so non-ascii ones get passed correctly - sending of non-ascii web pages doesn't work but that is bug 663183 and was already present.
* Ports TB Bug 549580 - If compose window initialisation fails, don't hide the error by throwing it to the text console
Attachment #537923 - Attachment is obsolete: true
Attachment #538321 - Flags: review?(neil)
Blocks: 663183
Blocks: 663193
Changes since last version:
* Removed the double encoding of web page urls.
Attachment #538321 - Attachment is obsolete: true
Attachment #538321 - Flags: review?(neil)
Attachment #538632 - Flags: review?(neil)
Comment on attachment 538632 [details] [diff] [review]
With resolveURI but no double encoding

>+        var commandLine = Components.classes["@mozilla.org/toolkit/command-line;1"]
>+                                    .createInstance();
Heh, I had no idea that this component was readily available.

>+          if (uri.scheme == "file")
>+          {
>+            let localFile = fileHandler.getFileFromURLSpec(uri.spec);
I think you can write this as
if (uri instanceof Components.interface.nsIFileURL)
{
  if (uri.file.exists())
etc.
Attachment #538632 - Flags: review?(neil) → review+
Attachment #538632 - Attachment is obsolete: true
Attachment #538773 - Flags: review+
Comment on attachment 538773 [details] [diff] [review]
Using resolveURI and nsIFileURL [Checked in: Comment 6]

http://hg.mozilla.org/comm-central/rev/804b99311f80
Attachment #538773 - Attachment description: Using resolveURI and nsIFileURL → Using resolveURI and nsIFileURL [Checked in: Comment 6]
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → seamonkey2.4
You need to log in before you can comment on or make changes to this bug.