Saving attachment file should use Downloads.jsm directly



MailNews Core
3 years ago
2 years ago


(Reporter: hiro, Unassigned)


Firefox Tracking Flags

(Not tracked)


(Whiteboard: [patchlove])


(1 attachment, 5 obsolete attachments)



3 years ago
Created attachment 8515603 [details] [diff] [review]
WIP v1

We can put more important information on the download manager view.
For example, sender of attachment file is one of the important information.

Attaching patch shows sender info in the view.

Comment 1

3 years ago
Created attachment 8517977 [details] [diff] [review]
WIP v2

Implemented MsgDownloads.saveAllAttachments.
Attachment #8515603 - Attachment is obsolete: true

Comment 2

3 years ago
Created attachment 8518084 [details] [diff] [review]
WIP v3

Used also Downloads.jsm on detaching.
Attachment #8517977 - Attachment is obsolete: true

Comment 3

3 years ago
Created attachment 8518109 [details] [diff] [review]
WIP v4

Added received date property for future reference.
Attachment #8518084 - Attachment is obsolete: true

Comment 4

3 years ago
Created attachment 8518772 [details] [diff] [review]
add MsgDownload.jsm and use it
Attachment #8518109 - Attachment is obsolete: true


2 years ago
Whiteboard: [patchlove]
Created attachment 8687689 [details] [diff] [review]

Patch unbitrotted and const changed to var.

Aceman, does this patch look complete as it is? I'm thinking of adding a reference to the message to jump to the message from download item and maybe also adding the subject. But this is something for a followup bug.
Attachment #8518772 - Attachment is obsolete: true
Attachment #8687689 - Flags: review?(acelists)
Comment on attachment 8687689 [details] [diff] [review]

I see now with this patch the saved attachments aren't shown in the list after a restart of TB (removing the patch and opening TB shows them again).
Attachment #8687689 - Flags: review?(acelists)

Comment 7

2 years ago
Does anybody know what this does? Is MsgDownloads.jsm some new code from m-c that migrates us more to the new downloads backend used in FF?
Flags: needinfo?(mconley)
Not sure. A brief glance doesn't suggest it's a migrator - looks more like mail-specific utility functions that wrap Downloads.jsm. Hiro can probably tell us for sure.
Flags: needinfo?(mconley) → needinfo?(hiikezoe)

Comment 9

2 years ago
Yes, Downloads.jsm has a capability which stores additional information.  Sender name is an example.
Other examples:

* sent date: it does not equal to saved date.
* message subject: if the subject is shown in download list, user can easily find the original message which contained the attachment file, or find other attachment files in the same message.
Flags: needinfo?(hiikezoe)
You need to log in before you can comment on or make changes to this bug.