Few fixes to different internet fields

This commit is contained in:
Alexander S. Aganichev 2001-11-17 21:28:10 +00:00
parent 500807f9a0
commit 71c0ee1b4e
11 changed files with 42 additions and 25 deletions

View File

@ -12,6 +12,13 @@ ______________________________________________________________________
Notes for GoldED+ 1.1.5, /snapshot/ 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, ! Synchronized with recent Fidoconfig features. Removed -lame feature,
slashes no longer parsed as escape sequencies in neither case. slashes no longer parsed as escape sequencies in neither case.

View File

@ -710,7 +710,7 @@ CfgGed::CfgGed() {
ignorecharset = false; ignorecharset = false;
intensecolors = false; intensecolors = false;
internetmsgid = false; internetmsgid = false;
internetrfcbody = false; internetrfcbody = 0;
internetviagate = false; internetviagate = false;
keybmode = KEYB_POLL; keybmode = KEYB_POLL;
logformat = 0; logformat = 0;

View File

@ -205,7 +205,9 @@ void CfgInternetmsgid() {
void CfgInternetrfcbody() { void CfgInternetrfcbody() {
bool flag = GetYesno(val); int flag = atoi(val);
if(flag == 0)
flag = GetYesno(val) ? 1 : 0;
if(cfgingroup) if(cfgingroup)
CFG->grp.AddItm(GRP_INTERNETRFCBODY, flag); CFG->grp.AddItm(GRP_INTERNETRFCBODY, flag);
else else

View File

@ -243,7 +243,7 @@ public:
Node internetgate; Node internetgate;
int internetgateexp; int internetgateexp;
bool internetmsgid; bool internetmsgid;
bool internetrfcbody; int internetrfcbody;
bool internetviagate; bool internetviagate;
Invalidate invalidate; Invalidate invalidate;
Path jampath; Path jampath;

View File

@ -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* buf = (char*)throw_malloc(4096);
char* buf2 = (char*)throw_malloc(1024); 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 // 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) { if(line->kludge & stripkludges) {
bool waswrapped; bool waswrapped;
@ -258,7 +258,7 @@ void DoKludges(int mode, GMsg* msg, bool attronly) {
line = msg->lin; line = msg->lin;
if(attronly) { if(kludges == GKLUD_FLAGS) {
if(AA->isnet()) if(AA->isnet())
MakeFlags(msg, &line, buf); MakeFlags(msg, &line, buf);
} }
@ -443,6 +443,15 @@ void DoKludges(int mode, GMsg* msg, bool attronly) {
mime_header_encode(buf2, msg->re, msg); mime_header_encode(buf2, msg->re, msg);
strxcpy(msg->re, buf2, sizeof(ISub)); 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 { else {
if(*msg->ifrom) { if(*msg->ifrom) {
@ -577,11 +586,11 @@ void DoKludges(int mode, GMsg* msg, bool attronly) {
line = AddKludge(line, buf); line = AddKludge(line, buf);
line->kludge = GKLUD_RFC; line->kludge = GKLUD_RFC;
} }
}
if(AA->Internetrfcbody() and line->next and not strblank(line->next->txt.c_str())) { if(AA->Internetrfcbody() and line->next and not strblank(line->next->txt.c_str())) {
line = AddKludge(line, ""); line = AddKludge(line, "");
line->kludge = GKLUD_RFC; line->kludge = GKLUD_RFC;
}
} }
} }
else if(((mode != MODE_CHANGE) or AA->Internetrfcbody()) and AA->isnet()) { else if(((mode != MODE_CHANGE) or AA->Internetrfcbody()) and AA->isnet()) {

View File

@ -1610,7 +1610,7 @@ void ScanKludges(GMsg* msg, int getvalue) {
ptr++; ptr++;
msg->orig.reset(ptr); msg->orig.reset(ptr);
} }
else if(msg->msgid.valid()) if(msg->msgid.valid())
msg->orig = msg->msgid; 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 // Scan msg body top for RFC headerlines
if(AA->Internetrfcbody()) { int irfcbody = AA->Internetrfcbody();
if(irfcbody != 0) {
if(msg->lin) { if(msg->lin) {
Line* linep = msg->lin; Line* linep = msg->lin;
int headerlines = 0; int headerlines = 0;
@ -2512,7 +2513,7 @@ void MakeLineIndex(GMsg* msg, int margin, bool getvalue, bool header_recode) {
} }
} }
} }
else else if(--irfcbody == 0)
break; break;
} }
} }
@ -2521,7 +2522,8 @@ void MakeLineIndex(GMsg* msg, int margin, bool getvalue, bool header_recode) {
linep->type |= GLINE_KLUD; linep->type |= GLINE_KLUD;
linep->color = C_READK; linep->color = C_READK;
} }
break; if(--irfcbody == 0)
break;
} }
if(linep->type & GLINE_WRAP) { if(linep->type & GLINE_WRAP) {
while(linep and (linep->type & GLINE_WRAP)) { while(linep and (linep->type & GLINE_WRAP)) {

View File

@ -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)) if(not isuucp(msg->to))
strcpy(msg->realto, msg->to); strcpy(msg->realto, msg->to);
strcpy(msg->to, omsg->iaddr); strcpy(msg->to, omsg->iaddr);

View File

@ -95,7 +95,7 @@ void GetAreaconf();
char* MakeOrigin(GMsg* msg, const char* _origin); char* MakeOrigin(GMsg* msg, const char* _origin);
char* MakeTearline(GMsg* msg, char* buf); 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 DoTearorig(int mode, GMsg* msg);
void GetRandom(int mode, GMsg* msg); void GetRandom(int mode, GMsg* msg);
char* GetRandomLine(char* __buf, size_t __bufsize, const char* __file); char* GetRandomLine(char* __buf, size_t __bufsize, const char* __file);

View File

@ -56,7 +56,7 @@ void ChangeAttributes() {
AskAttributes(reader_msg); AskAttributes(reader_msg);
if(memcmp(msg, reader_msg, sizeof(GMsg))) { if(memcmp(msg, reader_msg, sizeof(GMsg))) {
msg->charsetlevel = LoadCharset(CFG->xlatlocalset, msg->charset); msg->charsetlevel = LoadCharset(CFG->xlatlocalset, msg->charset);
DoKludges(MODE_CHANGE, reader_msg, true); DoKludges(MODE_CHANGE, reader_msg, GKLUD_FLAGS);
reader_msg->LinesToText(); reader_msg->LinesToText();
AA->SaveMsg(GMSG_UPDATE, reader_msg); AA->SaveMsg(GMSG_UPDATE, reader_msg);
} }

View File

@ -946,16 +946,13 @@ void ConfirmMsg() {
} }
} }
if(not CFG->switches.get(rcvdisablescfm)) { 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.rrq0();
reader_msg->attr.cfm0(); reader_msg->attr.cfm0();
reader_msg->attr.upd1(); reader_msg->attr.upd1();
msg->charsetlevel = LoadCharset(CFG->xlatlocalset, msg->charset); reader_msg->charsetlevel = LoadCharset(CFG->xlatlocalset, reader_msg->charset);
DoKludges(MODE_CHANGE, reader_msg, true); DoKludges(MODE_CHANGE, reader_msg, GKLUD_FLAGS);
reader_msg->LinesToText(); reader_msg->LinesToText();
AA->SaveMsg(GMSG_UPDATE, reader_msg); AA->SaveMsg(GMSG_UPDATE, reader_msg);
throw_free(msg);
} }
} }

View File

@ -281,7 +281,7 @@ struct AreaData {
IAdr internetaddress; IAdr internetaddress;
Node internetgate; Node internetgate;
bool internetmsgid; bool internetmsgid;
bool internetrfcbody; int internetrfcbody;
Path loadlanguage; Path loadlanguage;
int msglistdate; int msglistdate;
bool msglistfast; bool msglistfast;
@ -537,7 +537,7 @@ public:
const char* Internetaddress() const { return adat->internetaddress; } const char* Internetaddress() const { return adat->internetaddress; }
const Node& Internetgate() const { return adat->internetgate; } const Node& Internetgate() const { return adat->internetgate; }
bool Internetmsgid() const { return adat->internetmsgid; } 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; } const char* Loadlanguage() const { return adat->loadlanguage; }
int Msglistdate() const { return adat->msglistdate; } int Msglistdate() const { return adat->msglistdate; }
bool Msglistfast() const { return adat->msglistfast; } bool Msglistfast() const { return adat->msglistfast; }