From 4057aba5d0fbf2325da0254296ca90b2e56954c5 Mon Sep 17 00:00:00 2001 From: Ianos Gnatiuc Date: Thu, 27 Oct 2005 23:41:58 +0000 Subject: [PATCH] Improved false quote detection --- docs/notework.txt | 2 ++ golded3/gclang.h | 2 +- golded3/geline.cpp | 6 ++++++ golded3/geprot.h | 2 +- golded3/geutil.cpp | 14 ++++++++++++-- goldlib/gmb3/gmo_msg.h | 4 +++- 6 files changed, 25 insertions(+), 5 deletions(-) diff --git a/docs/notework.txt b/docs/notework.txt index 999c579..9c1b274 100644 --- a/docs/notework.txt +++ b/docs/notework.txt @@ -10,6 +10,8 @@ ______________________________________________________________________ Notes for GoldED+ 1.1.5, /snapshot/ ______________________________________________________________________ ++ Improved false quote detection. + + New menu item "Toggle sent" added to "Action" menu that will toggle sent/unsent state for current or marked messages. diff --git a/golded3/gclang.h b/golded3/gclang.h index 335f726..53b4efa 100644 --- a/golded3/gclang.h +++ b/golded3/gclang.h @@ -282,7 +282,7 @@ const word CRC_WT_SELECTACTION = 0xF7C0; const word CRC_MI_FORWARDMESSAGE = 0x644C; const word CRC_MI_MOVEMESSAGE = 0xAB24; const word CRC_MI_COPYMESSAGE = 0x6811; -const word CRC_MI_TOGGLESENT = 0; +const word CRC_MI_TOGGLESENT = 0x31f9; const word CRC_MI_QUITCMF = 0xE1B8; const word CRC_ST_ARE = 0x78C8; const word CRC_ST_IS = 0x27AC; diff --git a/golded3/geline.cpp b/golded3/geline.cpp index 3ee8cb9..edcb953 100644 --- a/golded3/geline.cpp +++ b/golded3/geline.cpp @@ -2702,6 +2702,12 @@ void MsgLineReIndex(GMsg* msg, int viewhidden, int viewkludge, int viewquote) { continue; } } + else if (line->type & GLINE_TXTH) + { + *qbuf0 = NUL; + qmatches = 0; + continue; + } else if(line->type & GLINE_QUOT) { if(not viewquote) { GetQuotestr(line->txt.c_str(), qbuf, &qlen); diff --git a/golded3/geprot.h b/golded3/geprot.h index b77201c..3e3d64a 100644 --- a/golded3/geprot.h +++ b/golded3/geprot.h @@ -393,7 +393,7 @@ int GetAkaNo(const ftn_addr& __aka); int GetQuotestr(const char* ptr, char* qbuf, uint* qlen); int cmp_quotes(char* q1, char* q2); int is_quote(const char* ptr); -bool is_quote2(const Line* line, const char* ptr); +bool is_quote2(Line* line, const char* ptr); int IsQuoteChar(const char* s); void maketitle(); int maketitle_and_status(char *); diff --git a/golded3/geutil.cpp b/golded3/geutil.cpp index 5366ed6..10d162e 100644 --- a/golded3/geutil.cpp +++ b/golded3/geutil.cpp @@ -373,7 +373,7 @@ int is_quote(const char* ptr) { // ------------------------------------------------------------------ -bool is_quote2(const Line* line, const char* ptr) +bool is_quote2(Line* line, const char* ptr) { if (!CFG->quoteusenewai) return true; @@ -410,6 +410,7 @@ bool is_quote2(const Line* line, const char* ptr) return true; // take a look at previous lines + Line *paragraph = NULL; for (Line *ln = line->prev; ln; ln = ln->prev) { // previous line is quoted? @@ -419,7 +420,14 @@ bool is_quote2(const Line* line, const char* ptr) if ((ln->txt.length() == 0) || (ln->txt[0] == LF) || (ln->txt[0] == CR)) - return true; + { + if (paragraph) return true; + else + { + paragraph = ln; + continue; + } + } // or kludge? if (ln->txt[0] == CTRL_A) return true; @@ -439,6 +447,8 @@ bool is_quote2(const Line* line, const char* ptr) return true; } + // hide false paragraph + if (paragraph) paragraph->type |= GLINE_TXTH; return false; // don't quote current line } } diff --git a/goldlib/gmb3/gmo_msg.h b/goldlib/gmb3/gmo_msg.h index 65acd04..60b3a64 100644 --- a/goldlib/gmb3/gmo_msg.h +++ b/goldlib/gmb3/gmo_msg.h @@ -81,7 +81,8 @@ const uint GLINE_POSI = 0x0100; const uint GLINE_HIGH = 0x0200; const uint GLINE_TAGL = 0x0400; const uint GLINE_SIGN = 0x0800; -const uint GLINE_NOAL = 0x1000; // text is not allocated +const uint GLINE_TXTH = 0x1000; // text is hiden +const uint GLINE_NOAL = 0x2000; // text is not allocated const uint GLINE_KLUDGE = GLINE_HIDD | GLINE_KLUD; const uint GLINE_ALL = GLINE_HIDD | GLINE_KLUD | GLINE_QUOT; @@ -162,6 +163,7 @@ public: int isposition() { return !!(type & GLINE_POSI); } int ishighlighted() { return !!(type & GLINE_HIGH); } int istagline() { return !!(type & GLINE_TAGL); } + int istxthidden() { return !!(type & GLINE_TXTH); } int isheader() { return !!kludge; } int isallocated() { return !(type & GLINE_NOAL); }