Closed Bug 113684 Opened 23 years ago Closed 20 years ago

Disable prepending of "-- \n" before .sig if a "-- \n" is already in the sig

Categories

(MailNews Core :: Composition, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

VERIFIED DUPLICATE of bug 229044
Future

People

(Reporter: askwar, Assigned: bugzilla)

References

Details

It would be very good, if there were a way to disable prepending the "-- \n"
signature delimiter before a .sig.  My .sig alread contains a "-- \n", so the
one added by Mozilla is just not needed.

Additionally, it would be very good if Mozilla would detect if there's a a line
matching "^-- $" in the signature file.  If there's such a line, Mozilla should
not add the "-- \n" by itself.
See bug 30208.  Is the "-- \n" not the first thing in your .sig file?
No, "-- \n" is not the first line in my .sig.  The .sig I use is:

------ START -------
Alexander Skwar
-- 
How to quote: http://learn.to/quote (german) http://quote.6x.to (en)
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
        -=» Suche Wohnung in Gelsenkirchen und Umgebung! «=- 
                       Uptime: 1 day 3 hours 50 minutes
------ ENDE ---------

(Without the --START-- and --END--)
setting status to new, but see discussion in bug 30208 about why we don't do
what you ask for...
Status: UNCONFIRMED → NEW
Ever confirmed: true
QA Contact: sheelar → esther
Well, do you want changes here in this bug, or in the other bug?
Hmm, I'm not much of a C++ hacker, but to detect if the sigData contains "--
\n", wouldn't it be sufficient to change lines 3011, 3012
(http://lxr.mozilla.org/seamonkey/source/mailnews/compose/src/nsMsgCompose.cpp#3011)
to:

if (!(sigData.Find("-- \n", PR_TRUE, 0, 1) ||
      sigData.Find("-- \r", PR_TRUE, 0, 1)))

This should search sigData for any occurance of "-- \n" or "-- \r", and if it
finds one, it doesn't add the sigdashes.
Probably, but that would scan the whole signature file twice in the normal case.
We at least want to keep it to one scan and probably limit the amount of data
scanned before giving up to.
Hmm, yes, it scans twice, however, I don't see this as a major performance hit.
 But, you are right, it for sure will take longer than the current approach.

Hm, as I said, I'm not much of a C++ hacker, and I much less know the Mozilla
sources well enough.  However, here's another idea.

a) Split sigData into lines (delimited by some EOL, or "\n", or "\r")
b) Start scanning at line 0
c) Check if line length is equal to 3
d) If yes, check if line is equal to "-- "
d2) "Remember" that no sigdash should be inserted
d3) Bail out of the sigcheck
e) If not, get the next line
e2) Goto step c)

The difference with this approach is, that sigData needs to be split, and that
it needs to loop thru all the lines of sigData.
Well... the simple thing to do is to seach sigData for "-- " using
FindInReadable and then check that the second iter points to a \n or \r.

The hard part is making this play nice with HTML signatures which may contain
embedded comments.
Also, you must check so that the "-- " is alone on a line. It mustn't be
triggered by the text: 

"And then we waited some more -- "
> The hard part is making this play nice with HTML signatures

We should not search for "-- " at all in the HTML sig. "-- " is for plaintext.
Summary: Disable prepending of "-- \n" before .sigs/Detect if "-- \n" is in .sig → Disable prepending of "-- \n" before .sig if a "-- \n" is already in the sig
Thanks, that's just what I though, and I also thought that this was said in the other 
bug.

Besides, does the current way work for HTML?

Because of the "problems" with 
lines in a .sig like "foo -- ", I'd still think that the right way to go was to split the lines.  Then, after the 
lines are split, loop thru all the lines and check the if the line is 3 chars long and is equal to "-- 
".

Dunno, but isn't it possible to get the lines of a nsAutoString (sigData is of this type)?
*** Bug 115039 has been marked as a duplicate of this bug. ***
Hm, I was thinking about this.  Why does there need to be any "inteligence" at
all?  I'd propose to throw away the autodetection and add a setting "[x] Prepend
signature delimiter before the signature".  This setting should be enabled by
default.
- the less prefs UI the better
- We should (or even have to?) force a sig delim., esp. for newbies not knowing
the consequences of disabling it.
Well, I do not think that the delim should be forced at all.  Yes, Mozilla
*should* use the delim, if the user wishes so.  Quite a lot of mail/news clients
allow to disable the deli.

To cater for the newbies, the setting really should default to using the delim.
 And this setting might/should be hidden in some "advanced" prefs.
Status: NEW → ASSIGNED
Target Milestone: --- → Future
*** Bug 142289 has been marked as a duplicate of this bug. ***
I'd keep the target far in future, as there's really a big pain in the **** for
someone who just migrated to Mozilla Mail and is now unable to keep old habits
and sigs.
well, ch.ey fixed this in new bug 229044.

*** This bug has been marked as a duplicate of 229044 ***
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
vrfy.
Status: RESOLVED → VERIFIED
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.