Applied SeqMsgID patch

This commit is contained in:
Alexander S. Aganichev 2003-04-03 14:28:59 +00:00
parent 034d8d2511
commit 8be702a36f
12 changed files with 130 additions and 9 deletions

View File

@ -4,7 +4,7 @@ include GNUmakef.def
.PHONY: all clean distclean dirs sourcelists deps .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 EXECUTABLES=golded3 goldnode rddt
all: sourcelists all: sourcelists

View File

@ -12,6 +12,34 @@ ______________________________________________________________________
Notes for GoldED+ 1.1.5, /snapshot/ 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 - Fixed active messages counter for JAM messagebases if message
restored by removing DEL attribute. restored by removing DEL attribute.
@ -484,8 +512,8 @@ ______________________________________________________________________
- GoldED+ will now treat all unknown charsets to be equal to - GoldED+ will now treat all unknown charsets to be equal to
Xlatimport. Xlatimport.
- Fixed AreaReplyDirect operation when AreaReply is defined (Thanks to - Fixed AreaReplyDirect operation when AreaReplyTo is defined (Thanks
Pavel Gulchouck for the patch). to Pavel Gulchouck for the patch).
- Fixed problem with incorrect updating of timesread field when - Fixed problem with incorrect updating of timesread field when
MSGLISTFIRST is YES. MSGLISTFIRST is YES.

View File

@ -3,8 +3,8 @@
TOP=.. TOP=..
SHORTTARGET=ged SHORTTARGET=ged
TARGET=golded3 TARGET=golded3
GLIBS=gmb3 gall gcfg uulib 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 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) ifeq ($(findstring EMX, $(PATH)), EMX)
STDLIBS=-los2me -lstdcpp STDLIBS=-los2me -lstdcpp

View File

@ -106,6 +106,9 @@ bool ReadGoldedCfg(int& force) {
MakePathname(CFG->outputfile, CFG->goldpath, CFG->outputfile); MakePathname(CFG->outputfile, CFG->goldpath, CFG->outputfile);
MakePathname(CFG->inputfile, CFG->goldpath, CFG->inputfile); MakePathname(CFG->inputfile, CFG->goldpath, CFG->inputfile);
if(*CFG->seqdir)
MakePathname(CFG->seqdir, CFG->goldpath, CFG->seqdir);
if(*CFG->souptosslog) if(*CFG->souptosslog)
MakePathname(CFG->souptosslog, CFG->goldpath, CFG->souptosslog); MakePathname(CFG->souptosslog, CFG->goldpath, CFG->souptosslog);
@ -327,7 +330,7 @@ void InstallDetect(char* path) {
if(fexist(cmdlinecfgbak)) if(fexist(cmdlinecfgbak))
remove(cmdlinecfgbak); remove(cmdlinecfgbak);
rename(CFG->goldcfg, 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; std::cout << "Please wait while GoldED+ is detecting your software." << std::endl;
@ -585,6 +588,7 @@ CfgGed::CfgGed() {
*pathreportfile = 0; *pathreportfile = 0;
*pcboardpath = 0; *pcboardpath = 0;
*quotebuffile = 0; *quotebuffile = 0;
*seqdir = 0;
*soundpath = 0; *soundpath = 0;
*soupexportpath = 0; *soupexportpath = 0;
*soupimportpath = 0; *soupimportpath = 0;
@ -754,6 +758,8 @@ CfgGed::CfgGed() {
screenmaxcol = 0; screenmaxcol = 0;
screenmaxrow = 0; screenmaxrow = 0;
screensize = 0; screensize = 0;
seqmsgid = MAYBE;
seqoutrun = 0;
sharemode = cmdlinesharemode; sharemode = cmdlinesharemode;
showdeleted = false; showdeleted = false;
soupexportmargin = 76; soupexportmargin = 76;

View File

@ -318,6 +318,9 @@ const word CRC_SCREENUSEBIOS = 0x43DE;
const word CRC_SEARCHFOR = 0x9FA6; const word CRC_SEARCHFOR = 0x9FA6;
const word CRC_SEMAPHORE = 0x02FB; const word CRC_SEMAPHORE = 0x02FB;
const word CRC_SERIALNO = 0x6EDE; 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_SHAREMODE = 0x068E;
const word CRC_SHOWDELETED = 0xA9CE; const word CRC_SHOWDELETED = 0xA9CE;
const word CRC_SOUNDDEVICE = 0x831D; const word CRC_SOUNDDEVICE = 0x831D;

View File

@ -511,6 +511,9 @@ SwitchS:
case CRC_SCREENSIZE : CfgScreensize (); break; case CRC_SCREENSIZE : CfgScreensize (); break;
case CRC_SEARCHFOR : CfgSearchfor (); break; case CRC_SEARCHFOR : CfgSearchfor (); break;
case CRC_SEMAPHORE : CfgSemaphore (); 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_SHAREMODE : CfgSharemode (); break;
case CRC_SHOWDELETED : CfgShowdeleted (); break; case CRC_SHOWDELETED : CfgShowdeleted (); break;
case CRC_SOUNDPATH : CfgSoundpath (); break; case CRC_SOUNDPATH : CfgSoundpath (); break;

View File

@ -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() { void CfgSharemode() {
if(atoi(val)) if(atoi(val))

View File

@ -303,6 +303,9 @@ void CfgScreensize ();
void CfgScreenusebios (); void CfgScreenusebios ();
void CfgSearchfor (); void CfgSearchfor ();
void CfgSemaphore (); void CfgSemaphore ();
void CfgSeqDir ();
void CfgSeqMsgId ();
void CfgSeqOutRun ();
void CfgSharemode (); void CfgSharemode ();
void CfgShowdeleted (); void CfgShowdeleted ();
void CfgSounddevice (); void CfgSounddevice ();

View File

@ -303,6 +303,9 @@ public:
int screensize; int screensize;
INam searchfor; INam searchfor;
Semaphore semaphore; Semaphore semaphore;
Path seqdir;
int seqmsgid;
ulong seqoutrun;
int sharemode; // share; int sharemode; // share;
bool showdeleted; bool showdeleted;
Path soundpath; Path soundpath;

View File

@ -32,7 +32,6 @@
// ------------------------------------------------------------------ // ------------------------------------------------------------------
static ulong msgcount = 0;
int _use_fwd = true; int _use_fwd = true;
@ -329,7 +328,7 @@ void DoKludges(int mode, GMsg* msg, int kludges) {
strcpy(buf, msg->iorig); strcpy(buf, msg->iorig);
strchg(buf, '@', '.'); strchg(buf, '@', '.');
} }
sprintf(buf2, "<GED%08lX@%s>", time(NULL)+(msgcount++), buf); sprintf(buf2, "<GED%08lX@%s>", getMsgId(), buf);
throw_release(msg->messageid); throw_release(msg->messageid);
msg->messageid = throw_strdup(buf2); msg->messageid = throw_strdup(buf2);
CvtMessageIDtoMSGID(buf2, buf, AA->echoid(), "MSGID"); CvtMessageIDtoMSGID(buf2, buf, AA->echoid(), "MSGID");
@ -337,7 +336,7 @@ void DoKludges(int mode, GMsg* msg, int kludges) {
} }
else { else {
msg->orig.make_string(buf2, msg->odom); 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()) { if(CFG->switches.get(usemsgid) and not AA->ispcboard()) {
sprintf(buf, "\001MSGID: %s", msg->msgids); sprintf(buf, "\001MSGID: %s", msg->msgids);

View File

@ -423,6 +423,13 @@ void update_addressbook(GMsg* msg, bool reverse = false, bool force = false);
void edit_addressbook(GMsg* msg); void edit_addressbook(GMsg* msg);
// ------------------------------------------------------------------
// GEMSGID prototypes
ulong getMsgId();
ulong getClassicMsgId();
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// SOFTCR management // SOFTCR management

View File

@ -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 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 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 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 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 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 gepost cpp all ovl bcd bco bcx djg emx lnx rsx wcn wco wcx cyg be