Update of /cvsroot/mahogany/M/src/classes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27860/src/classes
Modified Files:
QuotedText.cpp
Log Message:
added GetUnquotedText(); use it to only look for attachment-indicating regex in
the part of the message the user actually wrote
Index: QuotedText.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/classes/QuotedText.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -b -u -2 -r1.1 -r1.2
--- QuotedText.cpp 8 Apr 2006 20:56:02 -0000 1.1
+++ QuotedText.cpp 8 Apr 2006 21:14:30 -0000 1.2
@@ -26,4 +26,11 @@
// ----------------------------------------------------------------------------
+// options we use here
+// ----------------------------------------------------------------------------
+
+extern const MOption MP_MVIEW_QUOTED_MAXWHITESPACE;
+extern const MOption MP_MVIEW_QUOTED_MAXALPHA;
+
+// ----------------------------------------------------------------------------
// private functions prototypes
// ----------------------------------------------------------------------------
@@ -277,2 +284,36 @@
}
+// ============================================================================
+// other public functions
+// ============================================================================
+
+String GetUnquotedText(const String& text, Profile *profile)
+{
+ String unquoted;
+ unquoted.reserve(text.length());
+
+ const int maxWhite = READ_CONFIG(profile, MP_MVIEW_QUOTED_MAXWHITESPACE);
+ const int maxAlpha = READ_CONFIG(profile, MP_MVIEW_QUOTED_MAXALPHA);
+ QuoteData qd;
+ for ( const char *lineCur = text.c_str(); *lineCur; )
+ {
+ // find the start of the next line
+ const wxChar *lineNext = wxStrchr(lineCur, _T('\n'));
+
+ if ( CountQuoteLevel(lineCur, maxWhite, maxAlpha, qd) == 0 )
+ {
+ // +1 to take '\n' too
+ unquoted += String(lineCur, lineNext ? lineNext + 1 - lineCur
+ : String::npos);
+ }
+
+ if ( !lineNext )
+ break;
+
+ // go to the next line (skip '\n')
+ lineCur = lineNext + 1;
+ }
+
+ return unquoted;
+}
+
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Mahogany-cvsupdates mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates