Closed Bug 1639452 Opened 4 years ago Closed 4 years ago

rework ReplyIgnoreQuote to be a boolean parameter quote, passed to MailServices.compose.OpenComposeWindow

Categories

(MailNews Core :: Composition, task)

Tracking

(thunderbird78 wontfix)

RESOLVED FIXED
Thunderbird 79.0
Tracking Status
thunderbird78 --- wontfix

People

(Reporter: mkmelin, Assigned: rnons)

Details

Attachments

(1 file, 5 obsolete files)

https://searchfox.org/comm-central/rev/cfa832291ae06d6b814f8a9ebe1991a08f25da92/mailnews/compose/public/nsIMsgComposeParams.idl#57

We should never be messing with the compose type. Quoting or not should be a boolean parameter instead.

Not doing so would lead to further hacks e.g. for bug 1615996.

Assignee: nobody → remotenonsense
Attached patch 1639452.patch (obsolete) — Splinter Review
  • Removed ReplyIgnoreQuote from nsIMsgCompType
  • Added ignoreQuote param to OpenComposeWindow

I will push to Try to see if it breaks anything.

Attachment #9153298 - Flags: review?(mkmelin+mozilla)
Status: NEW → ASSIGNED
Comment on attachment 9153298 [details] [diff] [review]
1639452.patch

Review of attachment 9153298 [details] [diff] [review]:
-----------------------------------------------------------------

::: mailnews/compose/public/nsIMsgComposeService.idl
@@ +27,5 @@
>                           in MSG_ComposeFormat format,
>                           in nsIMsgIdentity identity,
>                           in AUTF8String from,
> +                         in nsIMsgWindow aMsgWindow,
> +                         in boolean ignoreQuote);

I think it would be preferable to have this parameter be optional, and name it better. Like

```
[optional] in boolean suppressReplyQuote
```

In general it's preferable to have optional parameters default to false.

When it's optional you only need to pass it in for the few cases we want to set that parameter.

Please also add a documentation comment in the .idl file
Attachment #9153298 - Flags: review?(mkmelin+mozilla)
Attached patch 1639452.patch (obsolete) — Splinter Review
  • Renamed ignoreQuote to suppressReplyQuote
  • Added some documentation to nsIMsgComposeService.idl

I thought about using optional parameter at first, but seems in most cases (compose types), we want to suppress reply quote. So even it's optional, we still often need to pass true. Unless we want to reverse this param to includeReplyQuote.

Attachment #9153298 - Attachment is obsolete: true
Attachment #9154062 - Flags: review?(mkmelin+mozilla)
Attached patch 1639452.patch (obsolete) — Splinter Review

Lint.

Attachment #9154062 - Attachment is obsolete: true
Attachment #9154062 - Flags: review?(mkmelin+mozilla)
Attachment #9154070 - Flags: review?(mkmelin+mozilla)

(In reply to Ping Chen (:rnons) from comment #5)

I thought about using optional parameter at first, but seems in most cases (compose types), we want to suppress reply quote.

Well, in most cases it's just not relevant. It only does something for the reply types and is ignored for all others. https://searchfox.org/comm-central/rev/771b2328aa3096e6c907f477d7ebd862c8bf0841/mailnews/compose/src/nsMsgComposeService.cpp#410-416
That's why it would be nice to be optional - not having to specify it when it's irrelevant. From a quick look at the patch, 7 or so of the cases are such that it's irrelevant.

Attached patch 1639452.patch (obsolete) — Splinter Review

Thanks, I see what you mean now. Fixed.

Attachment #9154070 - Attachment is obsolete: true
Attachment #9154070 - Flags: review?(mkmelin+mozilla)
Attachment #9154096 - Flags: review?(mkmelin+mozilla)
Comment on attachment 9154096 [details] [diff] [review]
1639452.patch

Review of attachment 9154096 [details] [diff] [review]:
-----------------------------------------------------------------

::: mailnews/extensions/newsblog/content/newsblogOverlay.js
@@ +323,5 @@
>    aFormat,
>    aIdentity,
>    aMsgWindow
>  ) {
> +  let suppressReplyQuote = true;

Not completely sure now, but shouldn't you pass this in around here: https://searchfox.org/comm-central/rev/b3dc7ad59deb6d0e37499ed167d93c467fb1ccb0/mail/base/content/mailCommands.js#244 (I guess this case was forgotten before) and actually use it?

Or at least it was always false before, and then you'd just use this parameter for rss.
Attachment #9154096 - Flags: review?(mkmelin+mozilla)
Attached patch 1639452.patch (obsolete) — Splinter Review

I should read the code more carefully. Changed to pass suppressReplyQuote to openComposeWindowForRSSArticle now.

Attachment #9154096 - Attachment is obsolete: true
Attachment #9154534 - Flags: review?(mkmelin+mozilla)
Comment on attachment 9154534 [details] [diff] [review]
1639452.patch

Review of attachment 9154534 [details] [diff] [review]:
-----------------------------------------------------------------

::: mail/base/content/mailCommands.js
@@ +241,5 @@
>              type,
>              format,
>              identity,
> +            msgWindow,
> +            suppressReplyQuote

Sorry, hadn't thought this through earlier. We don't allow replying to feeds, so this parameter should always be irrelevant for feeds and we don't want to pass it in there.

(Or, I notice replies are erroneously enabled in the context menu, but even then the parameter will be irrelevant since actual quoting the same ways as mails don't happen.)
Attachment #9154534 - Flags: review?(mkmelin+mozilla)
Attached patch 1639452.patchSplinter Review

Hope I get it right this time. Yes, the "Reply" items in the context menu of feeds confused me.

Attachment #9154534 - Attachment is obsolete: true
Attachment #9154833 - Flags: review?(mkmelin+mozilla)
Comment on attachment 9154833 [details] [diff] [review]
1639452.patch

Review of attachment 9154833 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good, thx! r=mkmelin
Attachment #9154833 - Flags: review?(mkmelin+mozilla) → review+
Target Milestone: --- → Thunderbird 79.0

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/ece38adeaaee
Change ReplyIgnoreQuote to be a boolean parameter. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: