jeevatkm/ReplyWithHeaderMozilla

Option "Default (Subject, Date, From, To, Cc)" works as "(From, Subject, Date, To, Cc)"

islobodin opened this issue · 1 comments

Thunderbird 68.7.0 (64-bit), ReplyWithHeader 2.2.1.

When I reply an email with the option "Default (Subject, Date, From, To, Cc)" set, I get the following header:

From: GitHub [mailto:noreply@github.com]
Subject: [GitHub] Please verify your device
Date: Friday, April 10, 2020, 21:22
To: Me me@myserver.ru

The way it is currently coded all header quoting starts with 'From'

A few changes in core.js will make the option "Default (Subject, Date, From, To, Cc)" do what it says.

For HTML emails change:

  rwhHdr += htmlTagPrefix + '<b>' + i18n.from[locale] + '</b> ' + pHeader.from + htmlTagSuffix;

  if (headerQuotLblSeq == 0) { // jshint ignore:line
    rwhHdr += htmlTagPrefix + '<b>' + i18n.subject[locale] + '</b> ' + pHeader.subject + htmlTagSuffix;
    rwhHdr += htmlTagPrefix + '<b>' + i18n.date[locale] + '</b> ' + pHeader.date + htmlTagSuffix;
    rwhHdr += htmlTagPrefix + '<b>' + i18n.to[locale] + '</b> ' + pHeader.to + htmlTagSuffix;

    if (pHeader.cc) {
      rwhHdr += htmlTagPrefix + '<b>' + i18n.cc[locale] + '</b> ' + pHeader.cc + htmlTagSuffix;
    }

to:

  if (headerQuotLblSeq != 0) {
    rwhHdr += htmlTagPrefix + '<b>' + i18n.from[locale] + '</b> ' + pHeader.from + htmlTagSuffix;
  }

  if (headerQuotLblSeq == 0) { // jshint ignore:line
    rwhHdr += htmlTagPrefix + '<b>' + i18n.subject[locale] + '</b> ' + pHeader.subject + htmlTagSuffix;
    rwhHdr += htmlTagPrefix + '<b>' + i18n.date[locale] + '</b> ' + pHeader.date + htmlTagSuffix;
    rwhHdr += htmlTagPrefix + '<b>' + i18n.from[locale] + '</b> ' + pHeader.from + htmlTagSuffix;
    rwhHdr += htmlTagPrefix + '<b>' + i18n.to[locale] + '</b> ' + pHeader.to + htmlTagSuffix;

    if (pHeader.cc) {
      rwhHdr += htmlTagPrefix + '<b>' + i18n.cc[locale] + '</b> ' + pHeader.cc + htmlTagSuffix;
    }

For plain text emails change:

    rwhHdr += i18n.from[locale] + ' ' + pHeader.from + '<br/>';

  if (headerQuotLblSeq == 0) { // jshint ignore:line
    rwhHdr += i18n.subject[locale] + ' ' + pHeader.subject + '<br/>';
    rwhHdr += i18n.date[locale] + ' ' + pHeader.date + '<br/>';
    rwhHdr += i18n.to[locale] + ' ' + pHeader.to + '<br/>';

    if (pHeader.cc) {
      rwhHdr += i18n.cc[locale] + ' ' + pHeader.cc + '<br/>';
    }

to:

  if (headerQuotLblSeq != 0) {
    rwhHdr += i18n.from[locale] + ' ' + pHeader.from + '<br/>';
  }

  if (headerQuotLblSeq == 0) { // jshint ignore:line
    rwhHdr += i18n.subject[locale] + ' ' + pHeader.subject + '<br/>';
    rwhHdr += i18n.date[locale] + ' ' + pHeader.date + '<br/>';
    rwhHdr += i18n.from[locale] + ' ' + pHeader.from + '<br/>';
    rwhHdr += i18n.to[locale] + ' ' + pHeader.to + '<br/>';

    if (pHeader.cc) {
      rwhHdr += i18n.cc[locale] + ' ' + pHeader.cc + '<br/>';
    }