Closed Bug 86089 Opened 23 years ago Closed 23 years ago

need to clean up mime attachments code

Categories

(MailNews Core :: MIME, defect, P2)

defect

Tracking

(Not tracked)

VERIFIED FIXED
mozilla0.9.6

People

(Reporter: vparthas, Assigned: bugzilla)

References

Details

Attachments

(3 files, 2 obsolete files)

need to clean up mime attachments code- we use the same name as the forwarding 
subject for the temp file name and this forces us to hash the names.
we also need to use nsISupports instead of merely passing the attachments as 
strings.
as I understand it:

part of the problem is that when we forward a message, we create a temp file
using the subject of the message for the name.

it seems like we should be able to make the tmp file have one name, and the
attachment file name (within MIME) be something else.
I'll use this bug for the rewrite of the way we handle attachment in
nsIMsgCompFields and therefore inside mime as well.

In fact, we need to carry the following information for each attachment:
attachment name
url
content-type
charset
content-base
temporary, need to be deleted

I hope I did not forget anything...
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.6
Blocks: 86399
No longer blocks: 86399
Blocks: 87765
*** Bug 88855 has been marked as a duplicate of this bug. ***
Blocks: 89090
Keywords: nsbeta1+
Priority: -- → P2
Whiteboard: have fix
Attached patch Proposed fix, v1 (obsolete) — Splinter Review
Comment on attachment 54825 [details] [diff] [review]
and, there is the new file I forget to include in the first patch.

R=varada
Attachment #54825 - Flags: review+
Comment on attachment 54824 [details] [diff] [review]
Proposed fix, v1

r=varada;about time we had the attachment array :)
Attachment #54824 - Flags: review+
JF, could you fix the tabs in these files before you checkin? 
sure...
Attachment #54824 - Attachment is obsolete: true
Attachment #54825 - Attachment is obsolete: true
Attached file Changes explanation
Comment on attachment 55275 [details] [diff] [review]
proposed fix, v2 (same as v1 but untabified and updated with new tree)

r=varada
Attachment #55275 - Flags: review+
1) idl comments, like in nsIMsgAttachment

instead of //, do javadoc style comments.

so that they can be digestable by doxygen.

http://unstable.elemental.com/mozilla/

(see #16 on http://www.mozilla.org/hacking/reviewers.html)

good job on commenting the obsolete interfaces.  make sure to log bugs to remove
the obsolete stuff.

2)

I'm glad you fixed this:

-#ifdef XP_WIN
-  if (tempName && PL_strchr(tempName, '|'))
-  {
-    PR_Free(tempName);
-    tempName = nsnull;
-  }
-#endif
-#ifdef XP_MAC
-  if (tempName && PL_strlen(tempName) >= 31)
-    PR_DELETE(tempName)
-#endif

there's a bug on that somewhere, perhaps assigned to you, nhotta or me.

3)

fix string foo:

+          decodedSubject.InsertWithConversion("[Fwd: ", 0);
+          decodedSubject.AppendWithConversion("]");

instead do something like this:

decodedSubject.Insert(NS_LITERAL_STRING("Fwd: ").get(), 0);
decodedSubject.Append(NS_LITERAL_STRING("]").get());

other than that, it looks good.  some great cleanup, ducarroz.

sr=sspitzer
Comment on attachment 55275 [details] [diff] [review]
proposed fix, v2 (same as v1 but untabified and updated with new tree)

sr=sspitzer, once you clean up the idl comments and the string foo.
Attachment #55275 - Flags: superreview+
Answers to Seth question/comment:

1) will do before checked in
2) bug 89090
3) will do before check in

Thanks for the review.
fixed and checked in
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Whiteboard: have fix
As I understand it, this bug was a re-organization, cleanup of code, and
therefore isn't limited to a single testcase to verify.  Verified that this was
checked into the trunk, and new bugs on individual bugs should be logged separately.
Status: RESOLVED → VERIFIED
OS: Windows 2000 → All
QA Contact: esther → stephend
Hardware: PC → All
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: