Closed Bug 358247 Opened 18 years ago Closed 18 years ago

Port Bug 358121 and Bug 246414 to SeaMonkey (Phishing detector fix; Background and text colors lost when using a template)

Categories

(SeaMonkey :: MailNews: Message Display, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mcsmurf, Assigned: mcsmurf)

References

Details

(Keywords: fixed-seamonkey1.1)

Attachments

(2 files, 1 obsolete file)

Bug 358121 needs to be ported to SeaMonkey, the JS errors also occour in SeaMonkey:
Error: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIMsgMailNewsUrl.folder]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: chrome://messenger/content/mailWindowOverlay.js :: OnMsgLoaded :: line 2324"  data: no]
Source File: chrome://messenger/content/mailWindowOverlay.js
Line: 2324
Error: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIMsgMailNewsUrl.folder]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: chrome://messenger/content/phishingDetector.js :: isMsgEmailScam :: line 60"  data: no]
Source File: chrome://messenger/content/phishingDetector.js
Line: 60
Summary: Port Bug 358121 to SeaMonkey (Phishing detector throws an error when opening a .eml file) → Port Bug 358121 to SeaMonkey (Phishing detector throws an error when opening a .eml file)
Attached patch Patch (obsolete) — Splinter Review
Attachment #243694 - Flags: superreview?
Attachment #243694 - Flags: review?
Attachment #243694 - Flags: superreview?(neil)
Attachment #243694 - Flags: superreview?
Attachment #243694 - Flags: review?(neil)
Attachment #243694 - Flags: review?
Comment on attachment 243694 [details] [diff] [review]
Patch

>   // Ignore nntp and RSS messages
>-  var folder = aUrl.folder;
>-  if (folder.server.type == 'nntp' || folder.server.type == 'rss')
>+  // nsIMsgMailNewsUrl.folder can throw an error, especially if we are opening
>+  // a .eml message.
>+  var folder;
>+  try {
>+    folder = aUrl.folder;
>+  } catch (ex) {}
>+
>+  if (folder && (folder.server.type == 'nntp' || folder.server.type == 'rss'))
>     return isEmailScam;
You should test the variable inside the try block, since the folder isn't used anywhere else. Additionally consider using caching folder.server.type directly, or switch(!)ing to a switch statement.

>+    // nsIMsgMailNewsUrl.folder throws an error when opening .eml files.
>+    var folder;
>+    try {
>+      folder = aUrl.folder;
>+    } catch (ex) {}
Worth returning inside the catch block?
Attachment #243694 - Flags: superreview?(neil)
Attachment #243694 - Flags: superreview-
Attachment #243694 - Flags: review?(neil)
Attachment #243694 - Flags: review+
Attached patch Patch 2Splinter Review
Attachment #243694 - Attachment is obsolete: true
Attachment #244317 - Flags: superreview?(neil)
Attachment #244317 - Flags: review?(neil)
This patch now fixes Bug 234354, too.
Blocks: 234354
Comment on attachment 244317 [details] [diff] [review]
Patch 2

>+    if (!bodyElement.getAttribute("text"))
>+    if (!bodyElement.getAttribute("bgcolor"))
Nit: should be hasAttribute

>+    } catch (ex) {return;}
Nit: return; on its own line please

r+sr=me with these fixed.
Attachment #244317 - Flags: superreview?(neil)
Attachment #244317 - Flags: superreview+
Attachment #244317 - Flags: review?(neil)
Attachment #244317 - Flags: review+
Patch checked in by Bernd.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Summary: Port Bug 358121 to SeaMonkey (Phishing detector throws an error when opening a .eml file) → Port Bug 358121 and Bug 246414 to SeaMonkey (Phishing detector fix; Background and text colors lost when using a template)
Attachment #244317 - Flags: approval-seamonkey1.1?
Comment on attachment 244317 [details] [diff] [review]
Patch 2

second-a=me for 1.1
Attachment #244317 - Flags: approval-seamonkey1.1? → approval-seamonkey1.1+
Comment on attachment 244318 [details] [diff] [review]
Patch to check in

landed on the branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: