Update of /cvsroot/mahogany/M/src/classes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10690/src/classes
Modified Files:
ComposeTemplate.cpp
Log Message:
don't discard too much text when replying to/forwarding messages with lines of dashes
in the middle
Index: ComposeTemplate.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/classes/ComposeTemplate.cpp,v
retrieving revision 1.63
retrieving revision 1.64
diff -b -u -2 -r1.63 -r1.64
--- ComposeTemplate.cpp 16 Mar 2004 00:00:58 -0000 1.63
+++ ComposeTemplate.cpp 22 Apr 2004 12:56:05 -0000 1.64
@@ -636,6 +636,9 @@
String lineCur;
- // the last detected signature start
+ // 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++ )
@@ -650,4 +653,9 @@
// remember that the sig apparently starts here
posSig = value.length();
+ numLinesAfterSig = 0;
+ }
+ else if ( posSig != -1 )
+ {
+ numLinesAfterSig++;
}
}
@@ -736,4 +744,11 @@
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);
}
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates