In my previous entry I complained that opensource developers write the software that they want, which isn’t necessarily the same as the software that the users want.
I interpreted the responses to my change request as “We don’t agree with you enough to make the change”, where as what they actually meant was “We don’t agree with you strongly enough to be bothered to make the change ourselves” – the upshot of this being that when I went ahead and hacked the code myself to remove the annoying double-dash separator, the response I got was; “Could you finish the job and make this into a patch that can actually be merged back into the codebase?”. In other words, I got roped into fixing the problem properly.
In my previous entry I posted a patch that would allow you to remove the double-dash signature separator from Thunderbird if you were willing to recompile it from source yourself. I’ve now patched it properly so that there’s a new configuration option to allow anyone to change this setting at runtime – in other words I’ve done myself what I was trying to get the Thunderbird development team to do. My patch is now awaiting review and will hopefully be merged into the Thunderbird codebase in time to make the next major release (version 3).
I, as a developer, have added a feature to Thunderbird that I wanted, a feature that plenty of other people also wanted, but because no other developer had taken it upon himself to implement this feature; those who wanted it have been waiting 9 years! The point being, as a user, you only get the features you want if you’re also a developer, or if a developer happens to agree with you.
The change is actually pretty trivial – the default behaviour remains completely unchanged, and if you create a signature in Thunderbird it will still automatically add the double-dash separator before the signature. However, as a result of my patch, it will soon be possible to disable this irritating behaviour by manually setting a special configuration preference using Thunderbird’s built-in config editor. This is the preference you need to use (where ? is a number between 1 and the total number of identities you have set up) – it’s a boolean field, set it to true to disable the behaviour:
mail.identity.id?.suppress_signature_separator
And for the sake of completeness, below you’ll find the patch that I’ve submitted for inclusion in the next release of Thunderbird. Hopefully you won’t actually need to use this because it will be merged into the Thunderbird codebase.
diff -r 20c2d9e8e9b4 mailnews/base/public/nsIMsgIdentity.idl
--- a/mailnews/base/public/nsIMsgIdentity.idl Thu Dec 31 13:43:40 2009 +0530
+++ b/mailnews/base/public/nsIMsgIdentity.idl Sat Jan 02 20:00:55 2010 +0000
@@ -135,16 +135,21 @@ interface nsIMsgIdentity : nsISupports {
attribute AString htmlSigText;
/**
* Does htmlSigText contain HTML? Use plain text if false.
*/
attribute boolean htmlSigFormat;
/**
+ * Suppress the double-dash signature separator
+ */
+ attribute boolean suppressSigSep;
+
+ /**
* The encoded string representing the vcard.
*/
attribute ACString escapedVCard;
attribute boolean doFcc;
/// URI for the fcc (Sent) folder
attribute ACString fccFolder;
attribute boolean fccReplyFollowsParent;
diff -r 20c2d9e8e9b4 mailnews/base/util/nsMsgIdentity.cpp
--- a/mailnews/base/util/nsMsgIdentity.cpp Thu Dec 31 13:43:40 2009 +0530
+++ b/mailnews/base/util/nsMsgIdentity.cpp Sat Jan 02 20:00:55 2010 +0000
@@ -193,16 +193,18 @@ NS_IMPL_IDPREF_BOOL(FccReplyFollowsParen
NS_IMPL_IDPREF_STR(DraftsFolderPickerMode, "drafts_folder_picker_mode")
NS_IMPL_IDPREF_STR(ArchivesFolderPickerMode, "archives_folder_picker_mode")
NS_IMPL_IDPREF_STR(TmplFolderPickerMode, "tmpl_folder_picker_mode")
NS_IMPL_IDPREF_BOOL(BccSelf, "bcc_self")
NS_IMPL_IDPREF_BOOL(BccOthers, "bcc_other")
NS_IMPL_IDPREF_STR (BccList, "bcc_other_list")
+NS_IMPL_IDPREF_BOOL(SuppressSigSep, "suppress_signature_separator")
+
NS_IMETHODIMP
nsMsgIdentity::GetDoBcc(PRBool *aValue)
{
nsresult rv = mPrefBranch->GetBoolPref("doBcc", aValue);
if (NS_SUCCEEDED(rv))
return rv;
PRBool bccSelf = PR_FALSE;
@@ -571,16 +573,17 @@ nsMsgIdentity::Copy(nsIMsgIdentity *iden
COPY_IDENTITY_INT_VALUE(identity,GetReplyOnTop,SetReplyOnTop)
COPY_IDENTITY_BOOL_VALUE(identity,GetSigBottom,SetSigBottom)
COPY_IDENTITY_BOOL_VALUE(identity,GetSigOnForward,SetSigOnForward)
COPY_IDENTITY_BOOL_VALUE(identity,GetSigOnReply,SetSigOnReply)
COPY_IDENTITY_INT_VALUE(identity,GetSignatureDate,SetSignatureDate)
COPY_IDENTITY_BOOL_VALUE(identity,GetAttachVCard,SetAttachVCard)
COPY_IDENTITY_STR_VALUE(identity,GetEscapedVCard,SetEscapedVCard)
COPY_IDENTITY_STR_VALUE(identity,GetSmtpServerKey,SetSmtpServerKey)
+ COPY_IDENTITY_BOOL_VALUE(identity,GetSuppressSigSep,SetSuppressSigSep)
return NS_OK;
}
NS_IMETHODIMP
nsMsgIdentity::GetRequestReturnReceipt(PRBool *aVal)
{
NS_ENSURE_ARG_POINTER(aVal);
diff -r 20c2d9e8e9b4 mailnews/compose/src/nsMsgCompose.cpp
--- a/mailnews/compose/src/nsMsgCompose.cpp Thu Dec 31 13:43:40 2009 +0530
+++ b/mailnews/compose/src/nsMsgCompose.cpp Sat Jan 02 20:00:55 2010 +0000
@@ -4040,25 +4040,28 @@ nsMsgCompose::ProcessSignature(nsIMsgIde
PRBool attachFile = PR_FALSE;
PRBool useSigFile = PR_FALSE;
PRBool htmlSig = PR_FALSE;
PRBool imageSig = PR_FALSE;
nsAutoString sigData;
nsAutoString sigOutput;
PRInt32 reply_on_top = 0;
PRBool sig_bottom = PR_TRUE;
+ PRBool suppressSigSep = PR_FALSE;
nsCOMPtr sigFile;
if (identity)
{
if (!CheckIncludeSignaturePrefs(identity))
return NS_OK;
identity->GetReplyOnTop(&reply_on_top);
identity->GetSigBottom(&sig_bottom);
+ identity->GetSuppressSigSep(&suppressSigSep);
+
rv = identity->GetAttachSignature(&attachFile);
if (NS_SUCCEEDED(rv) && attachFile)
{
rv = identity->GetSignature(getter_AddRefs(sigFile));
if (NS_SUCCEEDED(rv) && sigFile) {
rv = sigFile->GetNativePath(sigNativePath);
if (NS_SUCCEEDED(rv) && !sigNativePath.IsEmpty()) {
PRBool exists = PR_FALSE;
@@ -4118,17 +4121,17 @@ nsMsgCompose::ProcessSignature(nsIMsgIde
if (imageSig)
{
// We have an image signature. If we're using the in HTML composer, we
// should put in the appropriate HTML for inclusion, otherwise, do nothing.
if (m_composeHTML)
{
sigOutput.AppendLiteral(htmlBreak);
sigOutput.AppendLiteral(htmlsigopen);
- if (reply_on_top != 1 || sig_bottom || !aQuoted)
+ if (!suppressSigSep && reply_on_top != 1 || sig_bottom || !aQuoted)
sigOutput.AppendLiteral(dashes);
sigOutput.AppendLiteral(htmlBreak);
sigOutput.AppendLiteral("
");
@@ -4205,17 +4208,17 @@ nsMsgCompose::ProcessSignature(nsIMsgIde
if ((reply_on_top != 1 || sig_bottom || !aQuoted) &&
sigData.Find("\r-- \r", PR_TRUE) < 0 &&
sigData.Find("\n-- \n", PR_TRUE) < 0 &&
sigData.Find("\n-- \r", PR_TRUE) < 0)
{
nsDependentSubstring firstFourChars(sigData, 0, 4);
- if (!(firstFourChars.EqualsLiteral("-- \n") ||
+ if (!suppressSigSep && !(firstFourChars.EqualsLiteral("-- \n") ||
firstFourChars.EqualsLiteral("-- \r")))
{
sigOutput.AppendLiteral(dashes);
if (!m_composeHTML || !htmlSig)
sigOutput.AppendLiteral(CRLF);
else if (m_composeHTML)
sigOutput.AppendLiteral(htmlBreak);







Hello,
I would like to use your patch to remove this annoying double dash before my sig, but unfortunately I have no idea how to put it into practice
Would you be so kind and explain it to me? Thanks alot in advance.
Greetings from Poland,
Lukasz
Hi,
thank’s for the tip, but I cannot find it in Thunderbird editor…
Is there some update, or patch to add this option?
Thank you!
Jindra
This feature is coming in Thunderbird 3.3, either be patient and wait for the new version, or download a nightly build from the following URL:
http://ftp.mozilla.org/pub/mozilla.org/thunderbird/nightly/
Windows installer at:
http://ftp.mozilla.org/pub/mozilla.org/thunderbird/nightly/3.3a1-candidates/build1/win32/en-US/