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

RESOLVED FIXED in mozilla1.2final

Status

Core Graveyard
View Source
P1
normal
RESOLVED FIXED
15 years ago
8 years ago

People

(Reporter: Pratik, Assigned: bz)

Tracking

Trunk
mozilla1.2final

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

15 years ago
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.
(Reporter)

Comment 1

15 years ago
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?

Comment 4

15 years ago
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.

Comment 6

15 years ago
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
Created attachment 103130 [details] [diff] [review]
patch

reviews?

Comment 10

15 years ago
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?

Comment 12

15 years ago
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?

Comment 14

15 years ago
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 ;)
Created attachment 104326 [details] [diff] [review]
Patch v 1.2

review please?
Attachment #103130 - Attachment is obsolete: true

Comment 16

15 years ago
Comment on attachment 104326 [details] [diff] [review]
Patch v 1.2

sr=darin (thx!)
Attachment #104326 - Flags: superreview+

Updated

15 years ago
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
Comment on attachment 104326 [details] [diff] [review]
Patch v 1.2

a=roc+moz for trunk
Attachment #104326 - Flags: approval+
So let it be written.
Status: NEW → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → FIXED
Product: Browser → Seamonkey

Updated

8 years ago
Component: View Source → View Source
Product: SeaMonkey → Core Graveyard
You need to log in before you can comment on or make changes to this bug.