From 71c0ee1b4e4f526b9bc2d36929d8639009a4cf92 Mon Sep 17 00:00:00 2001 From: "Alexander S. Aganichev" Date: Sat, 17 Nov 2001 21:28:10 +0000 Subject: [PATCH] Few fixes to different internet fields --- docs/notework.txt | 7 +++++++ golded3/gccfgg.cpp | 2 +- golded3/gccfgg5.cpp | 4 +++- golded3/gecfgg.h | 2 +- golded3/gectrl.cpp | 25 +++++++++++++++++-------- golded3/geline.cpp | 10 ++++++---- golded3/gepost.cpp | 2 +- golded3/geprot.h | 2 +- golded3/geread2.cpp | 2 +- golded3/getpls.cpp | 7 ++----- golded3/gmarea.h | 4 ++-- 11 files changed, 42 insertions(+), 25 deletions(-) diff --git a/docs/notework.txt b/docs/notework.txt index 17b9c18..1ca3224 100644 --- a/docs/notework.txt +++ b/docs/notework.txt @@ -12,6 +12,13 @@ ______________________________________________________________________ Notes for GoldED+ 1.1.5, /snapshot/ ______________________________________________________________________ +- Fixed old bug with ADDRESSLOOKUPFIRST when it set to the ORIGIN and + no valid address defined in the origin. + +! InternetRFCBody now could be defined to the digit, which specify the + number of RFC headers will be tried for detection. Only usefull + when you often receive messages multiple times gated by ifmail. + ! Synchronized with recent Fidoconfig features. Removed -lame feature, slashes no longer parsed as escape sequencies in neither case. diff --git a/golded3/gccfgg.cpp b/golded3/gccfgg.cpp index 5635841..6775255 100644 --- a/golded3/gccfgg.cpp +++ b/golded3/gccfgg.cpp @@ -710,7 +710,7 @@ CfgGed::CfgGed() { ignorecharset = false; intensecolors = false; internetmsgid = false; - internetrfcbody = false; + internetrfcbody = 0; internetviagate = false; keybmode = KEYB_POLL; logformat = 0; diff --git a/golded3/gccfgg5.cpp b/golded3/gccfgg5.cpp index 1768007..ea9f7df 100644 --- a/golded3/gccfgg5.cpp +++ b/golded3/gccfgg5.cpp @@ -205,7 +205,9 @@ void CfgInternetmsgid() { void CfgInternetrfcbody() { - bool flag = GetYesno(val); + int flag = atoi(val); + if(flag == 0) + flag = GetYesno(val) ? 1 : 0; if(cfgingroup) CFG->grp.AddItm(GRP_INTERNETRFCBODY, flag); else diff --git a/golded3/gecfgg.h b/golded3/gecfgg.h index 0cbe611..590df8f 100644 --- a/golded3/gecfgg.h +++ b/golded3/gecfgg.h @@ -243,7 +243,7 @@ public: Node internetgate; int internetgateexp; bool internetmsgid; - bool internetrfcbody; + int internetrfcbody; bool internetviagate; Invalidate invalidate; Path jampath; diff --git a/golded3/gectrl.cpp b/golded3/gectrl.cpp index 6255358..932ab38 100644 --- a/golded3/gectrl.cpp +++ b/golded3/gectrl.cpp @@ -226,7 +226,7 @@ const char* get_informative_string(void) { // ------------------------------------------------------------------ -void DoKludges(int mode, GMsg* msg, bool attronly) { +void DoKludges(int mode, GMsg* msg, int kludges) { char* buf = (char*)throw_malloc(4096); char* buf2 = (char*)throw_malloc(1024); @@ -240,9 +240,9 @@ void DoKludges(int mode, GMsg* msg, bool attronly) { // Strip all the kludges we insert ourselves - while(line) { + int stripkludges = (~kludges)&(GKLUD_RFC|GKLUD_FWD|GKLUD_INTL|GKLUD_FMPT|GKLUD_TOPT|GKLUD_FLAGS|GKLUD_AREA|GKLUD_MSGID|GKLUD_REPLY|GKLUD_PID|GKLUD_CHARSET|GKLUD_KNOWN|GKLUD_PATH|GKLUD_SEENBY); - int stripkludges = attronly ? GKLUD_FLAGS : (GKLUD_RFC|GKLUD_FWD|GKLUD_INTL|GKLUD_FMPT|GKLUD_TOPT|GKLUD_FLAGS|GKLUD_AREA|GKLUD_MSGID|GKLUD_REPLY|GKLUD_PID|GKLUD_CHARSET|GKLUD_KNOWN|(mode==MODE_FORWARD?(GKLUD_PATH|GKLUD_SEENBY):0)); + while(line) { if(line->kludge & stripkludges) { bool waswrapped; @@ -258,7 +258,7 @@ void DoKludges(int mode, GMsg* msg, bool attronly) { line = msg->lin; - if(attronly) { + if(kludges == GKLUD_FLAGS) { if(AA->isnet()) MakeFlags(msg, &line, buf); } @@ -443,6 +443,15 @@ void DoKludges(int mode, GMsg* msg, bool attronly) { mime_header_encode(buf2, msg->re, msg); strxcpy(msg->re, buf2, sizeof(ISub)); } + + if(AA->Internetrfcbody() and not AA->isnewsgroup() and line->next) { + const char *nline_txt = line->next->txt.c_str(); + if(not strblank(nline_txt) and not strnieql(nline_txt, "XPost:", 6) and + not strnieql(nline_txt, "Copy:", 5) and not strnieql(nline_txt, "BCopy:", 6)) { + line = AddKludge(line, ""); + line->kludge = GKLUD_RFC; + } + } } else { if(*msg->ifrom) { @@ -577,11 +586,11 @@ void DoKludges(int mode, GMsg* msg, bool attronly) { line = AddKludge(line, buf); line->kludge = GKLUD_RFC; } - } - if(AA->Internetrfcbody() and line->next and not strblank(line->next->txt.c_str())) { - line = AddKludge(line, ""); - line->kludge = GKLUD_RFC; + if(AA->Internetrfcbody() and line->next and not strblank(line->next->txt.c_str())) { + line = AddKludge(line, ""); + line->kludge = GKLUD_RFC; + } } } else if(((mode != MODE_CHANGE) or AA->Internetrfcbody()) and AA->isnet()) { diff --git a/golded3/geline.cpp b/golded3/geline.cpp index bf57224..b4d2c4a 100644 --- a/golded3/geline.cpp +++ b/golded3/geline.cpp @@ -1610,7 +1610,7 @@ void ScanKludges(GMsg* msg, int getvalue) { ptr++; msg->orig.reset(ptr); } - else if(msg->msgid.valid()) + if(msg->msgid.valid()) msg->orig = msg->msgid; } @@ -2481,7 +2481,8 @@ void MakeLineIndex(GMsg* msg, int margin, bool getvalue, bool header_recode) { } // Scan msg body top for RFC headerlines - if(AA->Internetrfcbody()) { + int irfcbody = AA->Internetrfcbody(); + if(irfcbody != 0) { if(msg->lin) { Line* linep = msg->lin; int headerlines = 0; @@ -2512,7 +2513,7 @@ void MakeLineIndex(GMsg* msg, int margin, bool getvalue, bool header_recode) { } } } - else + else if(--irfcbody == 0) break; } } @@ -2521,7 +2522,8 @@ void MakeLineIndex(GMsg* msg, int margin, bool getvalue, bool header_recode) { linep->type |= GLINE_KLUD; linep->color = C_READK; } - break; + if(--irfcbody == 0) + break; } if(linep->type & GLINE_WRAP) { while(linep and (linep->type & GLINE_WRAP)) { diff --git a/golded3/gepost.cpp b/golded3/gepost.cpp index 919e364..a724346 100644 --- a/golded3/gepost.cpp +++ b/golded3/gepost.cpp @@ -934,7 +934,7 @@ void MakeMsg(int mode, GMsg* omsg, bool ignore_replyto) { } } } - else if(*omsg->iaddr and (strlen(omsg->iaddr) < sizeof(Name))) { + else if(not AA->isinternet() and *omsg->iaddr and (strlen(omsg->iaddr) < sizeof(Name))) { if(not isuucp(msg->to)) strcpy(msg->realto, msg->to); strcpy(msg->to, omsg->iaddr); diff --git a/golded3/geprot.h b/golded3/geprot.h index 7becf2d..2e64c9d 100644 --- a/golded3/geprot.h +++ b/golded3/geprot.h @@ -95,7 +95,7 @@ void GetAreaconf(); char* MakeOrigin(GMsg* msg, const char* _origin); char* MakeTearline(GMsg* msg, char* buf); -void DoKludges(int mode, GMsg* msg, bool attronly = false); +void DoKludges(int mode, GMsg* msg, int kludges = 0); void DoTearorig(int mode, GMsg* msg); void GetRandom(int mode, GMsg* msg); char* GetRandomLine(char* __buf, size_t __bufsize, const char* __file); diff --git a/golded3/geread2.cpp b/golded3/geread2.cpp index 2ee4e2c..a63358b 100644 --- a/golded3/geread2.cpp +++ b/golded3/geread2.cpp @@ -56,7 +56,7 @@ void ChangeAttributes() { AskAttributes(reader_msg); if(memcmp(msg, reader_msg, sizeof(GMsg))) { msg->charsetlevel = LoadCharset(CFG->xlatlocalset, msg->charset); - DoKludges(MODE_CHANGE, reader_msg, true); + DoKludges(MODE_CHANGE, reader_msg, GKLUD_FLAGS); reader_msg->LinesToText(); AA->SaveMsg(GMSG_UPDATE, reader_msg); } diff --git a/golded3/getpls.cpp b/golded3/getpls.cpp index dab043f..b6320c9 100644 --- a/golded3/getpls.cpp +++ b/golded3/getpls.cpp @@ -946,16 +946,13 @@ void ConfirmMsg() { } } if(not CFG->switches.get(rcvdisablescfm)) { - GMsg* msg = (GMsg*)throw_malloc(sizeof(GMsg)); - memcpy(msg, reader_msg, sizeof(GMsg)); reader_msg->attr.rrq0(); reader_msg->attr.cfm0(); reader_msg->attr.upd1(); - msg->charsetlevel = LoadCharset(CFG->xlatlocalset, msg->charset); - DoKludges(MODE_CHANGE, reader_msg, true); + reader_msg->charsetlevel = LoadCharset(CFG->xlatlocalset, reader_msg->charset); + DoKludges(MODE_CHANGE, reader_msg, GKLUD_FLAGS); reader_msg->LinesToText(); AA->SaveMsg(GMSG_UPDATE, reader_msg); - throw_free(msg); } } diff --git a/golded3/gmarea.h b/golded3/gmarea.h index b261934..130e9c4 100644 --- a/golded3/gmarea.h +++ b/golded3/gmarea.h @@ -281,7 +281,7 @@ struct AreaData { IAdr internetaddress; Node internetgate; bool internetmsgid; - bool internetrfcbody; + int internetrfcbody; Path loadlanguage; int msglistdate; bool msglistfast; @@ -537,7 +537,7 @@ public: const char* Internetaddress() const { return adat->internetaddress; } const Node& Internetgate() const { return adat->internetgate; } bool Internetmsgid() const { return adat->internetmsgid; } - bool Internetrfcbody() const { return adat->internetrfcbody; } + int Internetrfcbody() const { return adat->internetrfcbody; } const char* Loadlanguage() const { return adat->loadlanguage; } int Msglistdate() const { return adat->msglistdate; } bool Msglistfast() const { return adat->msglistfast; }