Closed Bug 171396 Opened 22 years ago Closed 22 years ago

[FIXr]View Message Source shows actual message instead of source

Categories

(Core Graveyard :: View Source, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.2final

People

(Reporter: pratik.solanki, Assigned: bzbarsky)

Details

Attachments

(1 file, 1 obsolete file)

I couldn't come up with a better summary. feel free to change it.

With Build 2002092704 on Linux, when I do View Source of a mesage, I see the
actual source. Good. Now if I try doing View -> Syntax Highlighting, the
complete message shows up! No way to get back to the message source other than
closing/repopening the window. Also, it does not adhere to any of teh Original
HTML/Simple HTML/Plain text settings or the "do not load remote images in
Mail/News" settings.
Happens on Windows too, hence All/All. And this also happens when you do View ->
Character Coding and change it to something else.
OS: Linux → All
Hardware: PC → All
This is probably a view-source bug, not a mailnews one....
So this happens only for mail messages?  Not for HTML and such?

Are these POP or IMAP messages?
imap, i sent stephend some testcases. the problem doesn't occur for the same
messages if they're placed in local folders.
Sounds like a likely bug in the imap channel, then...  I'll look into it once I have 
imap access again, I guess.
I don't know if this is relevant, but if you look at the view source browser's
current URI then only for IMAP messages does it not begin with view-source:
That's exactly what would need to happen.  So the question is, why?  We've had a
problem with GetURI for view-source of IMAP already; IMAP's GetURI is
semi-broken... That could be related.
OK. This has nothing to do with the imap channel, really... except that docshell
is _somehow_ doing something odd for it.  In any case, patch coming up.
Assignee: sspitzer → bzbarsky
Component: Mail Window Front End → ViewSource
Priority: -- → P1
Product: MailNews → Browser
QA Contact: olgam → pmac
Summary: View Message Source shows actual message instead of source → [FIX]View Message Source shows actual message instead of source
Target Milestone: --- → mozilla1.2beta
Attached patch patch (obsolete) — Splinter Review
reviews?
Comment on attachment 103130 [details] [diff] [review]
patch

> nsViewSourceChannel::GetOriginalURI(nsIURI* *aURI)
> {
>+    NS_ASSERTION(aURI, "Null out param!");

nit:  NS_ENSURE_ARG_POINTER(aURI);


> NS_IMETHODIMP
> nsViewSourceChannel::SetOriginalURI(nsIURI* aURI)
> {
>-    NS_ENSURE_TRUE(mChannel, NS_ERROR_FAILURE);
>-
>-    return mChannel->SetOriginalURI(aURI);
>+    mOriginalURI = aURI;
>+    return NS_OK;
> }

ic... nice :)

r/sr=darin
Attachment #103130 - Flags: superreview+
> nit:  NS_ENSURE_ARG_POINTER(aURI);

Actually, I did it the other way on purpose... NS_ENSURE_ARG_POINTER does a
check-and-error-return in opt builds.. But either way.

As for the other.... I was just thinking about it some more.. should I propagate
the SetOriginalURI call down into mChannel as well?
yeah, i only suggested NS_ENSURE_ARG_POINTER because the other methods seem to
use it, but either way.

i'm not sure there is any advantage to propogating the SetOriginalURI call down
to the channel.  the underlying channel should never be exposed directly, so it
shouldn't matter.  at least, hmm... what happens if a view-source request
results in a HTTP redirect?  does the view-source channel still reference the
old channel?
looks like it does... that could be bad.
Yeah.. we should listen for redirects...  want me to roll that into this patch?
yeah, that might be a good idea.  you can probably get away with just checking
the request that arrives via OnStartRequest.  remember there's also the
multipart channel to deal with ;)
Attached patch Patch v 1.2Splinter Review
review please?
Attachment #103130 - Attachment is obsolete: true
Comment on attachment 104326 [details] [diff] [review]
Patch v 1.2

sr=darin (thx!)
Attachment #104326 - Flags: superreview+
Attachment #104326 - Flags: review+
Target Milestone: mozilla1.2beta → mozilla1.2final
Summary: [FIX]View Message Source shows actual message instead of source → [FIXr]View Message Source shows actual message instead of source
So let it be written.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Product: Browser → Seamonkey
Product: SeaMonkey → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: