Fixes, added highwater support for Jam

This commit is contained in:
Alexander S. Aganichev 2001-03-29 18:55:31 +00:00
parent 8d18199a04
commit 264399a2ec
19 changed files with 73 additions and 18 deletions

View File

@ -12,6 +12,14 @@ ______________________________________________________________________
Notes for GoldED+ 1.1.5, March xx 2001 Notes for GoldED+ 1.1.5, March xx 2001
______________________________________________________________________ ______________________________________________________________________
- Soft-deleted messages now not hided from messagelist right after
deletion any more.
+ Added new switch JamSMAPIHighwater. If defined GoldED+ will handle
highwaters just like SMAPI did. Recommended for use with HPT.
Defaults to No. Support for Crashmail II style highwaters added as
well.
! Message lister redesigned. Should be quicker if you roll up and down ! Message lister redesigned. Should be quicker if you roll up and down
but consumes more memory. but consumes more memory.

View File

@ -226,6 +226,7 @@ const word CRC_INTERNETSERVER = 0xA01B;
const word CRC_INVALIDATE = 0x69CB; const word CRC_INVALIDATE = 0x69CB;
const word CRC_JAMHARDDELETE = 0xE2D5; const word CRC_JAMHARDDELETE = 0xE2D5;
const word CRC_JAMPATH = 0x1200; const word CRC_JAMPATH = 0x1200;
const word CRC_JAMSMAPIHIGHWATER= 0x74A4;
const word CRC_KEYBCLEAR = 0xD407; const word CRC_KEYBCLEAR = 0xD407;
const word CRC_KEYBDEFAULTS = 0x9FAE; const word CRC_KEYBDEFAULTS = 0x9FAE;
const word CRC_KEYBEXT = 0xC48A; const word CRC_KEYBEXT = 0xC48A;

View File

@ -66,6 +66,7 @@ tglobalbool globalbool[gswitches_last] = {
{ CRC_AREALISTPAGEBAR }, // 0x6C37; { CRC_AREALISTPAGEBAR }, // 0x6C37;
{ CRC_USEMSGID }, // 0x6FDB; { CRC_USEMSGID }, // 0x6FDB;
{ CRC_LOOKUPNET }, // 0x7359; { CRC_LOOKUPNET }, // 0x7359;
{ CRC_JAMSMAPIHIGHWATER }, // 0x74A4;
{ CRC_SQUISHDIRECT }, // 0x7C35; { CRC_SQUISHDIRECT }, // 0x7C35;
{ CRC_FIDOHWMARKS }, // 0x7E07; { CRC_FIDOHWMARKS }, // 0x7E07;
{ CRC_MSGLISTPAGEBAR }, // 0x8041; { CRC_MSGLISTPAGEBAR }, // 0x8041;

View File

@ -1120,7 +1120,7 @@ int ReadKeysCfg(int force) {
vector<Macro>::iterator k; vector<Macro>::iterator k;
for(k=CFG->macro.begin(), n=0; k != CFG->macro.end(); k++, n++) { for(k=CFG->macro.begin(), n=0; k != CFG->macro.end(); k++, n++) {
if(k->type == 0) { if(k->type == 0) {
if((k->key == KK_Auto) or (k->key == 0x0300)) { if(k->key == KK_Auto) {
// Start automacro // Start automacro
mac = k->buf; mac = k->buf;
while(*mac) { while(*mac) {

View File

@ -216,7 +216,6 @@ void CfgInternetreply ();
void CfgInternetrfcbody (); void CfgInternetrfcbody ();
void CfgInternetserver (); void CfgInternetserver ();
void CfgInvalidate (); void CfgInvalidate ();
void CfgJamharddelete ();
void CfgJampath (); void CfgJampath ();
void CfgKeybclear (); void CfgKeybclear ();
void CfgKeybdefaults (); void CfgKeybdefaults ();

View File

@ -53,6 +53,7 @@ enum en_gswitches {
arealistpagebar, arealistpagebar,
usemsgid, usemsgid,
lookupnet, lookupnet,
jamsmapihw,
squishdirect, squishdirect,
fidohwmarks, fidohwmarks,
msglistpagebar, msglistpagebar,

View File

@ -120,8 +120,10 @@ void Area::DeleteMsg(GMsg* msg, int direction) {
if(isnet() and isfido()) if(isnet() and isfido())
TouchNetscan(false); TouchNetscan(false);
// Remove message from internal table if(not issmb() and not (isjam() and not CFG->switches.get(jamharddelete))) {
Msgn.Del(msg->msgno); // Remove message from internal table
Msgn.Del(msg->msgno);
}
// Update lastreads // Update lastreads
if(Msgn.Count()) if(Msgn.Count())

View File

@ -427,7 +427,6 @@ int EditHeaderinfo(int mode, GMsgHeaderView &view) {
ChgAttrs(YES, msg); ChgAttrs(YES, msg);
whelpdef(CFG->helpged, Key_F1, C_HELPB, C_HELPW, C_HELPQ, C_HELPS, NULL);
vcurshow(); vcurshow();
if(not (hedit.lookup or AA->isnet())) { if(not (hedit.lookup or AA->isnet())) {
char date2[25] = {""}; char date2[25] = {""};

View File

@ -1033,7 +1033,7 @@ void Initialize(int argc, char* argv[]) {
#ifndef GMB_NOJAM #ifndef GMB_NOJAM
if(AL.msgbases & MT_JAM) { if(AL.msgbases & MT_JAM) {
update_statuslinef("%s JAM", LNG->Checking); update_statuslinef("%s JAM", LNG->Checking);
JamInit(CFG->jampath, CFG->switches.get(jamharddelete)); JamInit(CFG->jampath, CFG->switches.get(jamharddelete), CFG->switches.get(jamsmapihw));
} }
#endif #endif
#ifndef GMB_NOPCB #ifndef GMB_NOPCB

View File

@ -571,7 +571,6 @@ void ChgAttrs(int mode, GMsg* __msg) {
} }
else { else {
DispAttrWindow(false); DispAttrWindow(false);
freonkey();
} }
} }
@ -582,7 +581,6 @@ void AskAttributes(GMsg* __msg) {
ChgAttrs(ALWAYS, __msg); ChgAttrs(ALWAYS, __msg);
update_statusline(LNG->ChangeAttrs); update_statusline(LNG->ChangeAttrs);
whelpdef(CFG->helpged, Key_F1, C_HELPB, C_HELPW, C_HELPQ, C_HELPS, NULL);
whelppcat(H_Attributes); whelppcat(H_Attributes);
gkey key; gkey key;

View File

@ -340,7 +340,6 @@ bool GMsgList::handle_key() {
break; break;
case KK_ListGotoNext: case KK_ListGotoNext:
listgotonext:
key = Key_Dwn; key = Key_Dwn;
default_handle_key(); default_handle_key();
break; break;

View File

@ -444,6 +444,7 @@ public:
int isjam() const; int isjam() const;
int ispcboard() const; int ispcboard() const;
int issquish() const; int issquish() const;
int issmb() const;
int iswildcat() const; int iswildcat() const;
int isadeptxbbs() const; int isadeptxbbs() const;
int isseparator() const; int isseparator() const;
@ -607,6 +608,7 @@ inline int Area::ishudson() const { return area->ishudson(); }
inline int Area::isjam() const { return area->isjam(); } inline int Area::isjam() const { return area->isjam(); }
inline int Area::ispcboard() const { return area->ispcboard(); } inline int Area::ispcboard() const { return area->ispcboard(); }
inline int Area::issquish() const { return area->issquish(); } inline int Area::issquish() const { return area->issquish(); }
inline int Area::issmb() const { return area->issmb(); }
inline int Area::iswildcat() const { return area->iswildcat(); } inline int Area::iswildcat() const { return area->iswildcat(); }
inline int Area::isadeptxbbs() const { return area->isadeptxbbs(); } inline int Area::isadeptxbbs() const { return area->isadeptxbbs(); }
inline int Area::isseparator() const { return area->isseparator(); } inline int Area::isseparator() const { return area->isseparator(); }

View File

@ -132,6 +132,7 @@ public:
int isjam() const; int isjam() const;
int ispcboard() const; int ispcboard() const;
int issquish() const; int issquish() const;
int issmb() const;
int iswildcat() const; int iswildcat() const;
int isadeptxbbs() const; int isadeptxbbs() const;
int isseparator() const; int isseparator() const;
@ -199,6 +200,7 @@ inline int gmo_area::ishudson() const { return cfg.ishudson(); }
inline int gmo_area::isjam() const { return cfg.isjam(); } inline int gmo_area::isjam() const { return cfg.isjam(); }
inline int gmo_area::ispcboard() const { return cfg.ispcboard(); } inline int gmo_area::ispcboard() const { return cfg.ispcboard(); }
inline int gmo_area::issquish() const { return cfg.issquish(); } inline int gmo_area::issquish() const { return cfg.issquish(); }
inline int gmo_area::issmb() const { return cfg.issmb(); }
inline int gmo_area::iswildcat() const { return cfg.iswildcat(); } inline int gmo_area::iswildcat() const { return cfg.iswildcat(); }
inline int gmo_area::isadeptxbbs() const { return cfg.isadeptxbbs(); } inline int gmo_area::isadeptxbbs() const { return cfg.isadeptxbbs(); }
inline int gmo_area::isseparator() const { return cfg.isseparator(); } inline int gmo_area::isseparator() const { return cfg.isseparator(); }

View File

@ -224,9 +224,11 @@ struct JamData {
int fhjdt; int fhjdt;
int fhjdx; int fhjdx;
int fhjlr; int fhjlr;
int fhjhw; // highwater if available
int islocked; // Area is locked? int islocked; // Area is locked?
int timesposted; int timesposted;
long lastpos; // Lastread position long lastpos; // Lastread position
long highwater;
JamLast lastrec; // .JLR Lastread record JamLast lastrec; // .JLR Lastread record
JamHdrInfo hdrinfo; // .JHR Header info record JamHdrInfo hdrinfo; // .JHR Header info record
}; };
@ -240,6 +242,7 @@ struct JamWide {
int lookreplies; int lookreplies;
const char* jampath; const char* jampath;
int harddelete; int harddelete;
int smapihw;
}; };

View File

@ -54,7 +54,7 @@ void JamExit() {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
void JamInit(const char* jampath, int harddelete) { void JamInit(const char* jampath, int harddelete, int jamsmapihw) {
GFTRK("JamInit"); GFTRK("JamInit");
@ -63,6 +63,7 @@ void JamInit(const char* jampath, int harddelete) {
jamwide->jampath = jampath; jamwide->jampath = jampath;
jamwide->harddelete = harddelete; jamwide->harddelete = harddelete;
jamwide->smapihw = jamsmapihw;
// Calculate CRC32 of our username for the lastreads // Calculate CRC32 of our username for the lastreads
INam _name; INam _name;

View File

@ -39,7 +39,7 @@ void JamArea::data_open() {
wide = jamwide; wide = jamwide;
data = jamdata + (jamdatano++); data = jamdata + (jamdatano++);
data->fhjhr = data->fhjdt = data->fhjdx = data->fhjlr = -1; data->fhjhr = data->fhjdt = data->fhjdx = data->fhjlr = data->fhjhw = -1;
data->islocked = false; data->islocked = false;
data->timesposted = 0; data->timesposted = 0;
data->lastpos = 0; data->lastpos = 0;
@ -102,6 +102,9 @@ void JamArea::raw_open() {
sprintf(file, "%s.jlr", path()); data->fhjlr = test_open(file); sprintf(file, "%s.jlr", path()); data->fhjlr = test_open(file);
if(NOT just_scanning) { if(NOT just_scanning) {
sprintf(file, "%s.jdt", path()); data->fhjdt = test_open(file); sprintf(file, "%s.jdt", path()); data->fhjdt = test_open(file);
if(not jamwide->smapihw) {
sprintf(file, "%s.cmhw", path()); data->fhjhw = ::sopen(file, O_RDWR|O_BINARY, WideSharemode, S_STDRW);
}
} }
GFTRK(NULL); GFTRK(NULL);
@ -114,10 +117,11 @@ void JamArea::raw_close() {
GFTRK("JamArea::raw_close"); GFTRK("JamArea::raw_close");
if(data->fhjlr != -1) ::close(data->fhjlr); data->fhjlr = -1; if(data->fhjlr != -1) { ::close(data->fhjlr); data->fhjlr = -1; }
if(data->fhjdx != -1) ::close(data->fhjdx); data->fhjdx = -1; if(data->fhjdx != -1) { ::close(data->fhjdx); data->fhjdx = -1; }
if(data->fhjdt != -1) ::close(data->fhjdt); data->fhjdt = -1; if(data->fhjdt != -1) { ::close(data->fhjdt); data->fhjdt = -1; }
if(data->fhjhr != -1) ::close(data->fhjhr); data->fhjhr = -1; if(data->fhjhr != -1) { ::close(data->fhjhr); data->fhjhr = -1; }
if(data->fhjhw != -1) { ::close(data->fhjhw); data->fhjhw = -1; }
GFTRK(NULL); GFTRK(NULL);
} }
@ -136,6 +140,11 @@ void JamArea::open_area() {
memset(&data->hdrinfo, 0, sizeof(JamHdrInfo)); memset(&data->hdrinfo, 0, sizeof(JamHdrInfo));
read(data->fhjhr, &data->hdrinfo, sizeof(JamHdrInfo)); read(data->fhjhr, &data->hdrinfo, sizeof(JamHdrInfo));
if(not jamwide->smapihw and (data->fhjhw != -1))
read(data->fhjhw, &data->highwater, sizeof(long));
else
data->highwater = -1;
// Is the signature invalid? // Is the signature invalid?
if(memcmp(data->hdrinfo.signature, JAM_SIGNATURE, 4)) { if(memcmp(data->hdrinfo.signature, JAM_SIGNATURE, 4)) {

View File

@ -69,6 +69,19 @@ void JamArea::lock() {
lseekset(data->fhjhr, 0); lseekset(data->fhjhr, 0);
read(data->fhjhr, &data->hdrinfo, sizeof(JamHdrInfo)); read(data->fhjhr, &data->hdrinfo, sizeof(JamHdrInfo));
if(not jamwide->smapihw) {
if(data->fhjhw == -1) {
Path file;
sprintf(file, "%s.cmhw", path()); data->fhjhw = ::sopen(file, O_RDWR|O_BINARY, WideSharemode, S_STDRW);
}
if(data->fhjhw != -1)
read(data->fhjhw, &data->highwater, sizeof(long));
else
data->highwater = -1;
}
else
data->highwater = -1;
GFTRK(NULL); GFTRK(NULL);
} }
@ -407,6 +420,18 @@ void JamArea::save_message(int __mode, gmsg* __msg, JamHdr& __hdr) {
// Update internal array // Update internal array
Msgn->Append(__msg->msgno); Msgn->Append(__msg->msgno);
} }
// Adjust the highwatermark if required
if(jamwide->smapihw and __msg->attr.uns()) {
if(data->hdrinfo.highwatermark >= __msg->msgno)
data->hdrinfo.highwatermark = __msg->msgno - 1;
}
else if((data->highwater != -1) and (data->fhjhw != -1)) {
if(data->highwater >= __msg->msgno) {
data->highwater = __msg->msgno - 1;
write(data->fhjhw, &data->highwater, sizeof(long));
}
}
} }
else { else {
scan(); scan();

View File

@ -135,7 +135,12 @@ Line* JamArea::make_dump_msg(Line*& lin, gmsg* __msg, char* lng_head) {
AddLineF(line, "ActiveMsgs : %lu", _base->activemsgs); AddLineF(line, "ActiveMsgs : %lu", _base->activemsgs);
AddLineF(line, "PasswordCRC : %08lXh", _base->passwordcrc); AddLineF(line, "PasswordCRC : %08lXh", _base->passwordcrc);
AddLineF(line, "BaseMsgNum : %lu", _base->basemsgnum); AddLineF(line, "BaseMsgNum : %lu", _base->basemsgnum);
AddLineF(line, "HighWaterMark : %lu", _base->highwatermark); if(jamwide->smapihw)
AddLineF(line, "HighWaterMark : %lu", _base->highwatermark);
else if(data->highwater != -1)
AddLineF(line, "HighWaterMark : %lu", data->highwater);
else
AddLineF(line, "HighWaterMark : unknown");
line = AddLine(line, ""); line = AddLine(line, "");
AddLineF(line, "Subfields:"); AddLineF(line, "Subfields:");
line = AddLine(line, ""); line = AddLine(line, "");

View File

@ -72,7 +72,7 @@ void HGWarnRebuild();
// ------------------------------------------------------------------ // ------------------------------------------------------------------
void JamInit(const char* jampath, int harddelete); void JamInit(const char* jampath, int harddelete, int smapihw);
void JamExit(); void JamExit();
void JamWideOpen(); void JamWideOpen();