Comment 137 for bug 369150

Revision history for this message
In , Neil-httl (neil-httl) wrote :

(From update of attachment 346538)
>+ rv = parser->MakeFullAddressString(decodedName.get(), pAddresses,
> getter_Copies(fullAddress));
(2×) The "old" code used to have fallback
e.g. decodedName.length() ? decodedName.get() : pNames

>+ recipient = NS_ConvertUTF8toUTF16(outCString);
(6×) These should be converted to the form
CopyUTF8toUTF16(outCString, recipient);

> if (from) {
>- val = MIME_DecodeMimeHeader(from, charset, PR_FALSE, PR_TRUE);
>- cFields->SetFrom(NS_ConvertUTF8toUTF16(val ? val : from));
>- PR_FREEIF(val);
>+ cFields->SetFrom(NS_ConvertUTF8toUTF16(from));
> }
>
> if (subject) {
> val = MIME_DecodeMimeHeader(subject, charset, PR_FALSE, PR_TRUE);
> cFields->SetSubject(NS_ConvertUTF8toUTF16(val ? val : subject));
> PR_FREEIF(val);
> }
It's confusing that some fields are decoded here and some are decoded elsewhere... is it possible to decode them all in the same place?

>+ if (!(name.LowerCaseEqualsLiteral("to") || name.LowerCaseEqualsLiteral("from") ||
>+ name.LowerCaseEqualsLiteral("cc") || name.LowerCaseEqualsLiteral("bcc") ||
>+ name.LowerCaseEqualsLiteral("reply-to") || name.LowerCaseEqualsLiteral("sender")))
>+ MimeHeaders_convert_header_value(opt, hdr_value);
What does MimeHeaders_convert_header_value do that we don't want it to?