Closed Bug 141531 Opened 22 years ago Closed 21 years ago

move quote reply pref (reply below/above) to account settings

Categories

(MailNews Core :: Composition, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.5beta

People

(Reporter: d.h, Assigned: iannbugzilla)

References

Details

Attachments

(4 files, 10 obsolete files)

46.38 KB, image/jpeg
Details
46.00 KB, image/jpeg
Details
47.82 KB, image/jpeg
Details
33.27 KB, patch
iannbugzilla
: review+
iannbugzilla
: superreview+
Details | Diff | Splinter Review
When replying to a message, Mozilla allows the user to set a preference of
quoting the original message and starting the reply either above or below the
quote.  This preference is currently universal (i.e., a single preference is
applied to all accounts).

The Mozilla newsgroup guidelines recommend bottom-posting and including selected
text, which is logical in the newsgroup context.  Email users appear to prefer
top-posting.  This forces the Mozilla user bypass the set preference in either
email or newsgroup posting by moving the cursor to the beginning or end of the
quoted text, contrary to the set preference.

Replying to messages would be simplified by allowing the user to select separate
options for email and newsgoups posting.  The most direct way to accomplish this
would appear to be moving the preference selection to the account settings page.
 In the alternative, it could involve two boxes in the Preferences/Composition
page, or separate pages for the two functions.
This should be over in the mailnews-specific prefs dialog anyway....
Status: UNCONFIRMED → NEW
Ever confirmed: true
*** Bug 144338 has been marked as a duplicate of this bug. ***
-->varada
Assignee: ducarroz → varada
*** Bug 134594 has been marked as a duplicate of this bug. ***
Even better would be a global _and_ an account-specific setting (very much like
for "Addressing / LDAP" setings).

-------------------------------------------------------------------------------
GLOBAL:  Reply [ below ] message.

-------------------------------------------------------------------------------
ACCOUNT: ( ) use global settings (currently: below message)
         (o) use different setting for this account: reply [ above ] message
-------------------------------------------------------------------------------

BTW What bugs me even more, is that we don't support the way *most* business
correspondence is: Reply above _and_ THE SIGNATURE IS ALSO ABOVE THE QUOTED MAIL.

PS. some keywords (e.g., mozilla1.2) may help this get on the radar. (Dan?)
Peter: Most business mail where the reply is above is that way because they use
Outlook or similar application. My company is 8,000+ strong and we demand that
replies are following the previous reply simply because chronological order
makes the most sense. Quoting above previous replies will effectively eliminate
anything following the two -- delimiter unless you manually delete it. If I
remember correctly, the default in Navigator/Communicator is reply *above*
because of a few Corporate Enterprise customers wanted it that way, it's never
been changed back to date.
[OT]
Jay: My company is 30,000+ strong and everybody (plus our clients) uses top
posting and top signature. So we can ignore reality and insist that this
standard is inflexible, or we can find a way to let people do things the way
they want.
[/OT]
Peter: That's fine as long as we can find a way to not further bloat the product
with an over-preferenced UI.
Jay: Preferences are good when they provide meaningful and useful choices. This
is such a case. Anyhow, it would be a preference that _can_ be left at the
defaults (mail: top-reply <-> newsgroups: bottom-reply). Currently, this most
useful scenario isn't even possible.

Currently, _every_ server pref has an *Addressing* group which _only_ contains
one LDAP setting. We could use this (nearly empty and rarely used) group, rename
it(?), and add this bug to it. It would still be a rarely used group, but users
would be able to separate mail and NG posting styles. This would be a good
improvement.
Summary: RFE: move quote reply pref to account setup → move quote reply pref (reply below/above) to account settings
taking all of varada's bugs.
Assignee: varada → sspitzer
[OT] Solution to question raised in comment #9: bug 62429 comment #74 [/OT]
*** Bug 199548 has been marked as a duplicate of this bug. ***
*** Bug 199578 has been marked as a duplicate of this bug. ***
This bug should be blocking bug 62429#c70 which already has 47 votes and
countless CC's. Dependency?
Blocks: 62429
Looking at fixing this with patch to bug 62429 -> Taking
Assignee: sspitzer → ian
Accepting
Status: NEW → ASSIGNED
This is my initial mockup of the preference's composition panel
This is my initial mockup of the Account Composition panel
Re. attachment 128902 [details] - A minor nit: Since the "composition" settings are, IMO,
more relevant than the LDAP settings, perhaps they should be moved to *above*
the LDAP settings.
If they were swapped round I'd also have to retitle the pane to be "Composition
& Addressing", not a problem but the final decision would be the superreviewer's
as it is asthetics (sp?).
Attached patch Initial Patch v0.5b (obsolete) — Splinter Review
This patch moves the global quoting preference to a per account basis with the
UI now under Mail & Newsgroup Account settings. Probably still needs some
tidying up.
With moving quoting preference to a per account basis, we could take advantange
of that to move the compose HTML preference from the main panel to the new
"Addressing & Composition" panel. Mockup shows proposed look.
Attached patch Patch v0.5c (obsolete) — Splinter Review
This patch is the same as v0.5b except it additionally move the compose in HTML
option to the new "Addressing & Composition" settings pane.
Attachment #128953 - Attachment is obsolete: true
Attachment #129017 - Flags: review?(neil.parkwaycc.co.uk)
Comment on attachment 129017 [details] [diff] [review]
Patch v0.5c

>-[scriptable, uuid(D3B4A420-D5AC-11d2-806A-006008128C4E)]
>+[scriptable, uuid(8cc20593-88de-488e-ab85-ee38c9e4646c)]
???

>+  /* should we override global quoting preference? */
>+  attribute boolean autoQuote;
>+
>+  /* what should our local quoting preference be? */
>+  attribute long replyOnTop;
I don't think the comments match with what the attributes do.

>+  <label hidden="true" wsm_persist="true" id="identity.replyOnTop"
>+        pref="true" preftype="int" prefattribute="value"
>+        prefstring="mail.identity.%identitykey%.reply_on_top"/>
>+  <label hidden="true" wsm_persist="true" id="identity.autoQuote"
>+        pref="true" preftype="bool" prefattribute="value"
>+        prefstring="mail.identity.%identitykey%.auto_quote"/>
You should be able to put the wsm_persist and id on the checkboxes and
menulist, so that the wsm will save the prefs for you.

>-  else
>-  {
>-	document.getElementById("useGlobalPref").removeAttribute("disabled");
>+  else {
>+    document.getElementById("useGlobalPref").removeAttribute("disabled");
Please don't change brace style; changing whitespace is acceptable if you also
provide a diff -w

>-      document.getElementById("directoriesList").getAttribute('value');
>+      document.getElementById("directoriesList").getAttribute("value");
Pointless.
Attachment #129017 - Flags: review?(neil.parkwaycc.co.uk) → review-
Attached patch Patch v0.5d generated using pud8 (obsolete) — Splinter Review
Addressing issues identified by Neil.
Most whitespace changes are to correctly the line up of the code within braces
or to replace tabs with spaces.
New uuids created for changes in interfaces.
Inlined my setupQuoteList as it wasn't being called from anywhere else.
Attachment #129017 - Attachment is obsolete: true
Same as Patch v0.5d except generated using extra w
Attachment #129095 - Flags: review?(neil.parkwaycc.co.uk)
Comment on attachment 129095 [details] [diff] [review]
Patch v0.5d generated using wpud8

>+  var quoteList = document.getElementById("identity.replyOnTop");
>+  if (quoteList.value == "")
>+    quoteList.setAttribute("value", 1);
What's the point of this?
Comment on attachment 129095 [details] [diff] [review]
Patch v0.5d generated using wpud8

> NS_IMETHODIMP
> nsMsgCompose::ConvertAndLoadComposeWindow(nsString& aPrefix,
>                                           nsString& aBuf,
>                                           nsString& aSignature,
>+                                          nsIMsgIdentity *identity,
>                                           PRBool aQuoted,
>                                           PRBool aHTMLEditor)
Well, there are two errors here. The minor error is not using the a prefix for
an argument. The major error is that an nsMsgCompose object already has an
m_identity variable, which is the one that was used to construct the
QuotingOutputStreamListener, that you're carefully sending back :-P
Attachment #129095 - Flags: review?(neil.parkwaycc.co.uk) → review-
Hmmm, re comment#28 there did used to be certain circumstances that produce a ""
value but I can't get it to happen any more, perhaps it was when I forgot to
reset my pref settings during testing.

RE comment#29 ConvertAndLoadComposeWindow is called from two different places
one with m_identity defined and the other with mIdentity defined hence passing
it the way I did and the way ProcessSignature also passes it (which is where I
looked at how to define the arguments to pass and where I got *identity from
unless things differ between NS_IMETHODIMP and nsresult functions).
Attached patch Patch v0.5e generated using pud8 (obsolete) — Splinter Review
Using m_identity and not altering nsMsgCompose interface
Attachment #129094 - Attachment is obsolete: true
As patch v0.5e excepted generated using added w
Attachment #129095 - Attachment is obsolete: true
Attachment #129133 - Flags: review?(neil.parkwaycc.co.uk)
There's just one issue that comes to mind... what about all the existing users
with non-default preferences, they'll have to reset them, for each identity...
Hmmm, good point, any ideas what has been done when things have been moved
previously?
Re: Comment #33

Users *should* read the release notes and *should* understand the caveats of
alpha/beta software as well as willing to accept the changes therein. Those that
most want the changes will be happy campers, those that don't still *should* be
content to have non-global per-account basis control. There will *always* be
those that moan and groan no matter what.
One option is to include a script that copies the preferences across to each
account and then deletes the old preferences, just not sure the best place for
that script to sit.
Another is to use the old preferences until the user goes in and sets new
preferences but, to me, that seems less tidy.
Re: Comment #36

Unless I'm missing your point, giving the user *more* control over the
per-account preferences and then taking them away with a script seems
counter-productive. Leave total control in the hands of the user, that's what
they beg for, IMHO.
My prefered option would be for the user to have to set their own per account
preferences, but if that is not acceptable then for the global preference to be
copied across to each account and then the global preference deleted and all
subsequent changes are made on a per account basis.
jay garcia, the problem is that this patch will effectively remove the global
preference from mailnews.reply_on_top replacing it with a default preference
mail.identity.default.reply_on_top thus anyone who changed their global
preference will think that their change has been lost, and might even want some
UI to change the new default preference (to which I would say about:config ;-)
Comment on attachment 129133 [details] [diff] [review]
Patch v0.5e generated using wpud8

Well I would be happy enough if this was relnoted to say "Each identity now has
its own quotation preferences which you will have to set up individually even
if you had changed quotation preferences in the past."

P.S. how did you get moz to rebuild after changing the uuid? it royally horked
my build and I had to remove that from the patch :-/
Attachment #129133 - Flags: review?(neil.parkwaycc.co.uk) → review+
Adding relnote keyword

As far as rebuilding, I did a |make clean| in mailnews and then a |make -f
client.mk build| in the root of the tree.
Keywords: relnote
Comment on attachment 129133 [details] [diff] [review]
Patch v0.5e generated using wpud8

Requesting superreview
Attachment #129133 - Flags: superreview?(bienvenu)
Targetting
Target Milestone: --- → mozilla1.5beta
this looks OK to me, except I think it's worth a try to upgrade people's prefs.
The way we used to do stuff like this is with a version pref for prefs.js. Now,
we seem to add a pref that's specific to the feature being upgraded, in this
case, something like "mailnews.quotingPrefs".

so, in mailnews.js, you'd add
pref("mailnews.quotingPrefs.version", 0);

then, in some startup code, where we load accounts, you'd get that pref. If it
was 0, then you'd apply the mailnews.reply_on_top pref to all accounts.
Actually, you'd only need to apply it if it wasn't the default, I guess. You'd
need to use catch + try to handle the case where the pref wasn't in prefs.js
(and thus was the default). Then, you'd update the version pref to 1 so we
wouldn't try to upgrade again.



we don't change uuid's when an interface has things added to it, generally. It's
not going to help anyone, and it's going to mess people up who pull and build
the tree. I'd remove that change.
One approach would be to try and query the old pref, and if it exists then apply
it to all accounts and delete the old pref. Perhaps in verifyAccounts()?
Re. Comment #23 
> move the compose HTML preference from the main panel to the new
> "Addressing & Composition" panel) 

Good idea. The *defaults* for new accounts should be: 
- e-mail account:    HTML-yes
- newsgroup account: HTML-no

I can't remember where this was brought up, but... The <account-name> preference
panel should only contain settings for things that are needed and don't/can't
have a sensible default (priciple: don't bug the user with settings that don't
*have* to be set). Therefore, we should:

A. keep the "Attach this Signature" in the main (<account-name>) panel.
B. Move "Compose in HTML" to "the "Addressing & Composition" panel.
C. Put the "Forward" (inine/attachment) and "Reply" (above/below/...) in the
"Addressing & Composition" panel.

PS. I wonder when people will ask to have "Spell-Check" and "Font" prefs on a
per-account basis. :-\ (but that should definetely be a separate bug)
Re: comment#46
Peter could you log separate bugs, if they don't already exist, on the issues
not covered by this bug such as different defaults for HTML composition
depending on account type and moving other preferences to be on a per account basis.
Ian, I just tested it (new e-mail and news accounts) and those defaults already
exist. No need for a new bug. 

Which "other preferences" were you referring to? The only thing not yet
discussed would be also moving the "Forward" (inine/attachment) setting. You
really want that in a separate bug? I can gladly do that. Alternatively, I could
just rename the summary here to include Forwarding (my preference).
Yes I would want "Forwarding" in a separate bug so the pros and cons can be
discussed there.
OK, I just filed bug 215252. Come to think of it, I can't see any reason for
that bug at the moment. Hopefully, someone will come up with a reason why users
might want forwarding "inline" in some accounts and "as attachment" in other
accounts. :-\
Attached patch accountUtils.js patch v0.1 (obsolete) — Splinter Review
Patch to accountUtils.js to migrate global quoting preferences to per account
ones.
Attachment #129287 - Flags: review?(neil.parkwaycc.co.uk)
Comment on attachment 129287 [details] [diff] [review]
accountUtils.js patch v0.1

>+    deletePrefs = true;
No need for this, just leave everything in the try/catch; if the prefs got
removed last time then this code will automatically be skipped.

>+    if (!auto_quote || (reply_on_top != 0)) {
Probably unnecessary, if it's combined with the last patch.

>+      var numAccounts = accounts.Count();
>+      var numIdentities = 0;
>+      for (var i = 0; i < numAccounts; i++) {
>+        var account = accounts.QueryElementAt(i, Components.interfaces.nsIMsgAccount);
>+        var identities = account.identities;
Actually I think the account manager holds a list of all identities, you don't
need to check each account in turn.

>+              pref.setIntPref("mail.identity."+identity.key+".reply_on_top", reply_on_top);
Surely identity.reply_no_top = reply_on_top; will do?
Attachment #129287 - Flags: review?(neil.parkwaycc.co.uk) → review-
the problem with doing it this way (deleting the original pref after upgrade) is
that if you use an older, stable version against the same profile, you'll lose
your original settings. In this case, it's probably not a big deal, but just
FYI. The versioning scheme doesn't have this problem. But, as I said, no big
deal, and this approach is OK.
Using identity.reply_no_top = reply_on_top gives me the following exception:

Exception... "Cannot modify properties of a WrappedNative" nsresult: "0x80570034
(NS_ERROR_XPC_CANT_MODIFY_PROP_ON_WN)

Revised patch coming soon...
Attachment #129287 - Attachment is obsolete: true
Comment on attachment 129312 [details] [diff] [review]
Revised accountUtils.js patch v0.2

not included the addition to mailnews.js but I will include that in the final
patch for superreview
Attachment #129312 - Flags: review?(neil.parkwaycc.co.uk)
Comment on attachment 129312 [details] [diff] [review]
Revised accountUtils.js patch v0.2

>         var am = Components.classes[accountManagerContractID].getService(Components.interfaces.nsIMsgAccountManager);
> 
>         var accounts = am.accounts;
> 
>+        // migrate quoting preferences from global to per account
>+        migrateGlobalQuotingPrefs(am.allIdentities);
>+
>         // as long as we have some accounts, we're fine.
>         var accountCount = accounts.Count();

Put migrateGlobalQuotingPrefs before var accounts for r=.
Attachment #129312 - Flags: review?(neil.parkwaycc.co.uk) → review+
Comment on attachment 129312 [details] [diff] [review]
Revised accountUtils.js patch v0.2

Wait a sec, are you sure that identity.reply_on_top = reply_on_top doesn't
work?
Comment on attachment 129312 [details] [diff] [review]
Revised accountUtils.js patch v0.2

Silly me, I meant identity.replyOnTop = reply_on_top :-[
Also I'm not sure why you set the quoting version in a try/catch.
Attachment #129312 - Flags: review+ → review-
try/catch was left over from when I was attempting to delete preferences and I
forgot to remove it.
I still get the same exception if I use identity.replyOnTop = reply_on_top;
Attached patch Patch v0.5f includes migration (obsolete) — Splinter Review
Takes on board all comments and migrates global prefs to per account prefs
Attachment #129132 - Attachment is obsolete: true
Attachment #129133 - Attachment is obsolete: true
Attachment #129312 - Attachment is obsolete: true
Attachment #129133 - Flags: superreview?(bienvenu)
Attachment #129380 - Flags: review?(neil.parkwaycc.co.uk)
Attachment #129380 - Flags: review?(neil.parkwaycc.co.uk) → review+
Attachment #129380 - Flags: superreview?(bienvenu)
Comment on attachment 129380 [details] [diff] [review]
Patch v0.5f includes migration

sr=bienvenu

One tiny nit, however:

this code is too clever by half :-)

+    if (!auto_quote || (reply_on_top != 0)) {
+      var numIdentities = allIdentities.Count();
+      var identity = null;
+      for (var j = 0; j < numIdentities; j++) {
+	 identity = allIdentities.QueryElementAt(j,
Components.interfaces.nsIMsgIdentity);
+	 if (identity.valid) {
+	   if (auto_quote)
+	     identity.replyOnTop = reply_on_top;
+	   else
+	     identity.autoQuote = false;
+	 }
+      }
+    }

even if auto-quote is turned off, you still want to carry forward the reply on
top pref to be consistent, because it's the value that's used by default if
auto-quoting is turned on.

Also,	  if (!auto_quote || (reply_on_top != 0)
this can just be !auto_quote || reply_on_top)
Attachment #129380 - Flags: superreview?(bienvenu) → superreview+
Attached patch Patch v0.5g (obsolete) — Splinter Review
Extra nits dealt with patch
Attachment #129380 - Attachment is obsolete: true
Oops, diff'd against wrong tree this is against the right tree.
Attachment #129473 - Attachment is obsolete: true
Comment on attachment 129476 [details] [diff] [review]
Patch v0.5g against correct tree

Carrying r+ and sr+ forward and asking for driver approval to check into 1.5b
Attachment #129476 - Flags: superreview+
Attachment #129476 - Flags: review+
Attachment #129476 - Flags: approval1.5b?
Comment on attachment 129476 [details] [diff] [review]
Patch v0.5g against correct tree

>+          if (auto_quote)
>+            identity.replyOnTop = reply_on_top;
>+          else {
>+            identity.autoQuote = false;
>+            identity.replyOnTop = reply_on_top;
>+          }
Still too clever? how about:
identity.autoQuote = auto_quote;
identity.replyOnTop = reply_on_top;
yes, Neil, that's exactly what I would have expected to see - the best course
here is to have the least amount of code, not the most efficient code, since
this is code that executes only once. And I'd think that your suggestion is
probably the fastest as well as the smallest.
Comment on attachment 129476 [details] [diff] [review]
Patch v0.5g against correct tree

a=asa (on behalf of drivers) for checkin to Mozilla 1.5beta.
Attachment #129476 - Flags: approval1.5b? → approval1.5b+
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Wouldn't it be better to have the "composition" settings *above* the
"Addressing" settings, since they are much more commonly used (especially "HTML
Y/N")? € 0.02
Would the panel have to be renamed Composition & Addressing as well? I'd say it
would, all fairly easy to change though. Log a new bug and cc me if you want.
Blocks: 216533
OK, I just filed bug 216533 for this.
No longer blocks: 216533
Blocks: 216533
*** Bug 209208 has been marked as a duplicate of this bug. ***
Keywords: relnote
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

Creator:
Created:
Updated:
Size: