Update of /cvsroot/mahogany/M/src/classes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30358/src/classes

Modified Files:
        ComposeTemplate.cpp 
Log Message:
removed signature detecting code, it is done by Signature view filter now

Index: ComposeTemplate.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/classes/ComposeTemplate.cpp,v
retrieving revision 1.67
retrieving revision 1.68
diff -b -u -2 -r1.67 -r1.68
--- ComposeTemplate.cpp 14 Jul 2004 16:11:28 -0000      1.67
+++ ComposeTemplate.cpp 14 Jul 2004 16:13:58 -0000      1.68
@@ -66,10 +66,8 @@
 extern const MOption MP_COMPOSE_USE_SIGNATURE_SEPARATOR;
 extern const MOption MP_DATE_FMT;
-extern const MOption MP_REPLY_DETECT_SIG;
 extern const MOption MP_REPLY_MSGPREFIX;
 extern const MOption MP_REPLY_MSGPREFIX_FROM_XATTR;
 extern const MOption MP_REPLY_MSGPREFIX_FROM_SENDER;
 extern const MOption MP_REPLY_QUOTE_EMPTY;
-extern const MOption MP_REPLY_SIG_SEPARATOR;
 extern const MOption MP_WRAPMARGIN;
 
@@ -563,11 +561,4 @@
 }
 
-// flags for ExpandOriginalText()
-enum
-{
-   NoDetectSig = 0,
-   DetectSig = 1
-};
-
 // put the text quoted according to our current quoting options with the given
 // reply prefix into value
@@ -575,6 +566,5 @@
 ExpandOriginalText(const String& text,
                    const String& prefix,
-                   Profile *profile,
-                   int flags = DetectSig)
+                   Profile *profile)
 {
    String value;
@@ -609,18 +599,4 @@
    }
 
-   // should we detect the signature and discard it?
-   bool detectSig = (flags & DetectSig) &&
-                        READ_CONFIG_BOOL(profile, MP_REPLY_DETECT_SIG);
-
-   DetectSignature signature;
-   if( detectSig )
-   {
-      if( !signature.Initialize(profile) )
-      {
-         profile->writeEntry(MP_REPLY_DETECT_SIG, false);
-         detectSig = false;
-      }
-   }
-
    // if != 0, then we're at the end of the current line
    size_t lenEOL = 0;
@@ -629,10 +605,4 @@
    String lineCur;
 
-   // the last detected signature start and the number of new lines after it
-   // which we use at the end to detect if we don't discard a too big part of
-   // the message
-   int posSig = -1;
-   size_t numLinesAfterSig = 0;
-
    for ( const wxChar *cptr = text.c_str(); ; cptr++ )
    {
@@ -640,18 +610,4 @@
       if ( lineCur.empty() )
       {
-         if ( detectSig )
-         {
-            if ( signature.StartsHere(cptr) )
-            {
-               // remember that the sig apparently starts here
-               posSig = value.length();
-               numLinesAfterSig = 0;
-            }
-            else if ( posSig != -1 )
-            {
-               numLinesAfterSig++;
-            }
-         }
-
          if ( !quoteEmpty && (lenEOL = IsEndOfLine(cptr)) != 0 )
          {
@@ -731,20 +687,4 @@
    }
 
-   // if we had a sig, truncate it now: we have to do it like this because
-   // otherwise we risk discarding a too big part of the message, e.g. if it
-   // contains a quoted message with a sig inside it so we want to discard
-   // everything after the last sig detected
-   if ( posSig != -1 )
-   {
-      // also check that it wasn't just a line of dashes in the middle of the
-      // messages -- the check is empirical, of course, but better than nothing
-      // as it avoids losing bottom half of messages containing ASCII art
-      //
-      // the value of 10 is arbitrary but hopefully no trailer nor signature is
-      // going to be more than 10 lines in length
-      if ( numLinesAfterSig < 10 )
-         value.erase(posSig);
-   }
-
    return value;
 }
@@ -1562,11 +1502,5 @@
    //else: template "text", so no reply prefix at all
 
-   *value = ExpandOriginalText
-            (
-               m_msgview->GetText(),
-               prefix,
-               m_profile,
-               NoDetectSig
-            );
+   *value = ExpandOriginalText(m_msgview->GetText(), prefix, m_profile);
 }
 
@@ -1620,5 +1554,5 @@
    const String prefix = GetReplyPrefix(msgOriginal, profile);
 
-   return ExpandOriginalText(text, prefix, profile, NoDetectSig);
+   return ExpandOriginalText(text, prefix, profile);
 }
 



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to