From 8be702a36fabc79fad9ab0f850267fd8ead11c5b Mon Sep 17 00:00:00 2001 From: "Alexander S. Aganichev" Date: Thu, 3 Apr 2003 14:28:59 +0000 Subject: [PATCH] Applied SeqMsgID patch --- Makefile | 2 +- docs/notework.txt | 32 +++++++++++++++++++-- golded3/Makefile | 4 +-- golded3/gccfgg.cpp | 8 +++++- golded3/gccfgg.h | 3 ++ golded3/gccfgg0.cpp | 3 ++ golded3/gccfgg7.cpp | 68 +++++++++++++++++++++++++++++++++++++++++++++ golded3/gcprot.h | 3 ++ golded3/gecfgg.h | 3 ++ golded3/gectrl.cpp | 5 ++-- golded3/geprot.h | 7 +++++ golded3/golded3.all | 1 + 12 files changed, 130 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 9fe9c4a..1489d81 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ include GNUmakef.def .PHONY: all clean distclean dirs sourcelists deps -LIBS=gall gcfg gmb3 glibc uulib smblib +LIBS=gall gcfg gmb3 glibc uulib smblib msgidlib EXECUTABLES=golded3 goldnode rddt all: sourcelists diff --git a/docs/notework.txt b/docs/notework.txt index c19ceb7..5e56a10 100644 --- a/docs/notework.txt +++ b/docs/notework.txt @@ -12,6 +12,34 @@ ______________________________________________________________________ Notes for GoldED+ 1.1.5, /snapshot/ ______________________________________________________________________ ++ Added Husky compatible MSGID generation algorithm. The following + keywords are added for configuration: + + SeqMsgId Yes/No/Maybe + Yes - Use SeqMsgId algorithm + No - Do not use SeqMsgId algorithm + Maybe - Use SeqMsgId algorithm if SeqDir is set explicitly (default) + + SeqDir pathname + If SeqDir not explicitly defined and SeqMsgId is set, then SEQDIR + environment variable will be used. Note that pathname mapping (by + using MapPath rules) only occurs when SeqDir defined explicitly. + + SeqOutRun num[y][d][h][w][m] + SeqOutRun defines maximum "run-away" time for the MSGID. If not + defined explicitly, then SEQOUT environment variable is used. If + SEQOUT is also not set, then default value equals to 3 years is + used. + The num defines number in seconds if neither one of modificators + is in use. The following modificators can be used: + y - year + d - day + h - hour + w - week + m - month (31 days) + + Thanks to Alexander Reznikov for the patch. + - Fixed active messages counter for JAM messagebases if message restored by removing DEL attribute. @@ -484,8 +512,8 @@ ______________________________________________________________________ - GoldED+ will now treat all unknown charsets to be equal to Xlatimport. -- Fixed AreaReplyDirect operation when AreaReply is defined (Thanks to - Pavel Gulchouck for the patch). +- Fixed AreaReplyDirect operation when AreaReplyTo is defined (Thanks + to Pavel Gulchouck for the patch). - Fixed problem with incorrect updating of timesread field when MSGLISTFIRST is YES. diff --git a/golded3/Makefile b/golded3/Makefile index 951774b..70e1212 100644 --- a/golded3/Makefile +++ b/golded3/Makefile @@ -3,8 +3,8 @@ TOP=.. SHORTTARGET=ged TARGET=golded3 -GLIBS=gmb3 gall gcfg uulib smblib -INCS=-I. -I$(TOP)/goldlib/gall -I$(TOP)/goldlib/gcfg -I$(TOP)/goldlib/gmb3 -I$(TOP)/goldlib/uulib -I$(TOP)/goldlib/smblib +GLIBS=gmb3 gall gcfg uulib smblib msgidlib +INCS=-I. -I$(TOP)/goldlib/gall -I$(TOP)/goldlib/gcfg -I$(TOP)/goldlib/gmb3 -I$(TOP)/goldlib/uulib -I$(TOP)/goldlib/smblib -I$(TOP)/goldlib/msgidlib ifeq ($(findstring EMX, $(PATH)), EMX) STDLIBS=-los2me -lstdcpp diff --git a/golded3/gccfgg.cpp b/golded3/gccfgg.cpp index 87e69d3..d470ca0 100644 --- a/golded3/gccfgg.cpp +++ b/golded3/gccfgg.cpp @@ -106,6 +106,9 @@ bool ReadGoldedCfg(int& force) { MakePathname(CFG->outputfile, CFG->goldpath, CFG->outputfile); MakePathname(CFG->inputfile, CFG->goldpath, CFG->inputfile); + if(*CFG->seqdir) + MakePathname(CFG->seqdir, CFG->goldpath, CFG->seqdir); + if(*CFG->souptosslog) MakePathname(CFG->souptosslog, CFG->goldpath, CFG->souptosslog); @@ -327,7 +330,7 @@ void InstallDetect(char* path) { if(fexist(cmdlinecfgbak)) remove(cmdlinecfgbak); rename(CFG->goldcfg, cmdlinecfgbak); - std::cout << "WARNING: Existing config backed up to " << cmdlinecfgbak << "!!!" << std::endl; + std::cout << "Warning: Existing config backed up to " << cmdlinecfgbak << "!!!" << std::endl; } std::cout << "Please wait while GoldED+ is detecting your software." << std::endl; @@ -585,6 +588,7 @@ CfgGed::CfgGed() { *pathreportfile = 0; *pcboardpath = 0; *quotebuffile = 0; + *seqdir = 0; *soundpath = 0; *soupexportpath = 0; *soupimportpath = 0; @@ -754,6 +758,8 @@ CfgGed::CfgGed() { screenmaxcol = 0; screenmaxrow = 0; screensize = 0; + seqmsgid = MAYBE; + seqoutrun = 0; sharemode = cmdlinesharemode; showdeleted = false; soupexportmargin = 76; diff --git a/golded3/gccfgg.h b/golded3/gccfgg.h index fbcd192..87d2484 100644 --- a/golded3/gccfgg.h +++ b/golded3/gccfgg.h @@ -318,6 +318,9 @@ const word CRC_SCREENUSEBIOS = 0x43DE; const word CRC_SEARCHFOR = 0x9FA6; const word CRC_SEMAPHORE = 0x02FB; const word CRC_SERIALNO = 0x6EDE; +const word CRC_SEQDIR = 0x6426; +const word CRC_SEQMSGID = 0xFAB3; +const word CRC_SEQOUTRUN = 0x46A9; const word CRC_SHAREMODE = 0x068E; const word CRC_SHOWDELETED = 0xA9CE; const word CRC_SOUNDDEVICE = 0x831D; diff --git a/golded3/gccfgg0.cpp b/golded3/gccfgg0.cpp index bd27d1b..0098010 100644 --- a/golded3/gccfgg0.cpp +++ b/golded3/gccfgg0.cpp @@ -511,6 +511,9 @@ SwitchS: case CRC_SCREENSIZE : CfgScreensize (); break; case CRC_SEARCHFOR : CfgSearchfor (); break; case CRC_SEMAPHORE : CfgSemaphore (); break; + case CRC_SEQDIR : CfgSeqDir (); break; + case CRC_SEQMSGID : CfgSeqMsgId (); break; + case CRC_SEQOUTRUN : CfgSeqOutRun (); break; case CRC_SHAREMODE : CfgSharemode (); break; case CRC_SHOWDELETED : CfgShowdeleted (); break; case CRC_SOUNDPATH : CfgSoundpath (); break; diff --git a/golded3/gccfgg7.cpp b/golded3/gccfgg7.cpp index a89aa48..97e011e 100644 --- a/golded3/gccfgg7.cpp +++ b/golded3/gccfgg7.cpp @@ -344,6 +344,74 @@ void CfgSemaphore() { // ------------------------------------------------------------------ +void CfgSeqDir() { + + MapPath(PathCopy(CFG->seqdir, val)); +} + +// ------------------------------------------------------------------ + +void CfgSeqMsgId() { + + CFG->seqmsgid = GetYesno(val); +} + +// ------------------------------------------------------------------ + +void CfgSeqOutRun_Error() { + + std::cout << "* Warning: Bad SeqOutrun value \'" << val << "\', ignored."<< std::endl; +} + +void CfgSeqOutRun() { + + char *p; + ulong s = 0; + + if(not isdigit((int)(*val))) { + CfgSeqOutRun_Error(); + return; + } + + s = (ulong)atol(val); + p = val; + while(isdigit((int)(*p))) + p++; + if(*p == '\0') { + CFG->seqoutrun = s; + if(veryverbose) + std::cout << " SeqOutRun: \'" << val << "\' --> " << CFG->seqoutrun << std::endl; + return; + } + if(p[1]) { + CfgSeqOutRun_Error(); + return; + } + switch(tolower(*p)) { + case 'y': + s *= 365; + case 'd': + s *= 24; + case 'h': + s *= 60*60; + break; + case 'w': + s *= 7l*24*60*60; + break; + case 'm': + s *= 31l*24*60*60; + break; + default: + CfgSeqOutRun_Error(); + return; + } + CFG->seqoutrun = s; + if(veryverbose) + std::cout << " SeqOutRun: \'" << val << "\' --> " << CFG->seqoutrun << std::endl; +} + +// ------------------------------------------------------------------ + void CfgSharemode() { if(atoi(val)) diff --git a/golded3/gcprot.h b/golded3/gcprot.h index b608ce5..bf73dd5 100644 --- a/golded3/gcprot.h +++ b/golded3/gcprot.h @@ -303,6 +303,9 @@ void CfgScreensize (); void CfgScreenusebios (); void CfgSearchfor (); void CfgSemaphore (); +void CfgSeqDir (); +void CfgSeqMsgId (); +void CfgSeqOutRun (); void CfgSharemode (); void CfgShowdeleted (); void CfgSounddevice (); diff --git a/golded3/gecfgg.h b/golded3/gecfgg.h index b7b55c4..d6516cb 100644 --- a/golded3/gecfgg.h +++ b/golded3/gecfgg.h @@ -303,6 +303,9 @@ public: int screensize; INam searchfor; Semaphore semaphore; + Path seqdir; + int seqmsgid; + ulong seqoutrun; int sharemode; // share; bool showdeleted; Path soundpath; diff --git a/golded3/gectrl.cpp b/golded3/gectrl.cpp index 0bf6172..1dcee5f 100644 --- a/golded3/gectrl.cpp +++ b/golded3/gectrl.cpp @@ -32,7 +32,6 @@ // ------------------------------------------------------------------ -static ulong msgcount = 0; int _use_fwd = true; @@ -329,7 +328,7 @@ void DoKludges(int mode, GMsg* msg, int kludges) { strcpy(buf, msg->iorig); strchg(buf, '@', '.'); } - sprintf(buf2, "", time(NULL)+(msgcount++), buf); + sprintf(buf2, "", getMsgId(), buf); throw_release(msg->messageid); msg->messageid = throw_strdup(buf2); CvtMessageIDtoMSGID(buf2, buf, AA->echoid(), "MSGID"); @@ -337,7 +336,7 @@ void DoKludges(int mode, GMsg* msg, int kludges) { } else { msg->orig.make_string(buf2, msg->odom); - sprintf(msg->msgids, "%s %08lx", buf2, time(NULL)+(msgcount++)); + sprintf(msg->msgids, "%s %08lx", buf2, getMsgId()); } if(CFG->switches.get(usemsgid) and not AA->ispcboard()) { sprintf(buf, "\001MSGID: %s", msg->msgids); diff --git a/golded3/geprot.h b/golded3/geprot.h index 5f684da..a9a1322 100644 --- a/golded3/geprot.h +++ b/golded3/geprot.h @@ -423,6 +423,13 @@ void update_addressbook(GMsg* msg, bool reverse = false, bool force = false); void edit_addressbook(GMsg* msg); +// ------------------------------------------------------------------ +// GEMSGID prototypes + +ulong getMsgId(); +ulong getClassicMsgId(); + + // ------------------------------------------------------------------ // SOFTCR management diff --git a/golded3/golded3.all b/golded3/golded3.all index ef02399..d14d422 100644 --- a/golded3/golded3.all +++ b/golded3/golded3.all @@ -64,6 +64,7 @@ gemlst cpp all ovl bcd bco bcx djg emx lnx rsx wcn wco wcx cyg be gemnus cpp all ovl bcd bco bcx djg emx lnx rsx wcn wco wcx cyg be gemrks cpp all ovl bcd bco bcx djg emx lnx rsx wcn wco wcx cyg be gemsgs cpp all ovl bcd bco bcx djg emx lnx rsx wcn wco wcx cyg be +gemsgid cpp all ovl bcd bco bcx djg emx lnx rsx wcn wco wcx cyg be genode cpp all ovl bcd bco bcx djg emx lnx rsx wcn wco wcx cyg be geplay cpp all ovl bcd bco bcx djg emx lnx rsx wcn wco wcx cyg be gepost cpp all ovl bcd bco bcx djg emx lnx rsx wcn wco wcx cyg be