Fixes, added highwater support for Jam
This commit is contained in:
parent
8d18199a04
commit
264399a2ec
@ -12,6 +12,14 @@ ______________________________________________________________________
|
||||
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
|
||||
but consumes more memory.
|
||||
|
||||
|
@ -226,6 +226,7 @@ const word CRC_INTERNETSERVER = 0xA01B;
|
||||
const word CRC_INVALIDATE = 0x69CB;
|
||||
const word CRC_JAMHARDDELETE = 0xE2D5;
|
||||
const word CRC_JAMPATH = 0x1200;
|
||||
const word CRC_JAMSMAPIHIGHWATER= 0x74A4;
|
||||
const word CRC_KEYBCLEAR = 0xD407;
|
||||
const word CRC_KEYBDEFAULTS = 0x9FAE;
|
||||
const word CRC_KEYBEXT = 0xC48A;
|
||||
|
@ -66,6 +66,7 @@ tglobalbool globalbool[gswitches_last] = {
|
||||
{ CRC_AREALISTPAGEBAR }, // 0x6C37;
|
||||
{ CRC_USEMSGID }, // 0x6FDB;
|
||||
{ CRC_LOOKUPNET }, // 0x7359;
|
||||
{ CRC_JAMSMAPIHIGHWATER }, // 0x74A4;
|
||||
{ CRC_SQUISHDIRECT }, // 0x7C35;
|
||||
{ CRC_FIDOHWMARKS }, // 0x7E07;
|
||||
{ CRC_MSGLISTPAGEBAR }, // 0x8041;
|
||||
|
@ -1120,7 +1120,7 @@ int ReadKeysCfg(int force) {
|
||||
vector<Macro>::iterator k;
|
||||
for(k=CFG->macro.begin(), n=0; k != CFG->macro.end(); k++, n++) {
|
||||
if(k->type == 0) {
|
||||
if((k->key == KK_Auto) or (k->key == 0x0300)) {
|
||||
if(k->key == KK_Auto) {
|
||||
// Start automacro
|
||||
mac = k->buf;
|
||||
while(*mac) {
|
||||
|
@ -216,7 +216,6 @@ void CfgInternetreply ();
|
||||
void CfgInternetrfcbody ();
|
||||
void CfgInternetserver ();
|
||||
void CfgInvalidate ();
|
||||
void CfgJamharddelete ();
|
||||
void CfgJampath ();
|
||||
void CfgKeybclear ();
|
||||
void CfgKeybdefaults ();
|
||||
|
@ -53,6 +53,7 @@ enum en_gswitches {
|
||||
arealistpagebar,
|
||||
usemsgid,
|
||||
lookupnet,
|
||||
jamsmapihw,
|
||||
squishdirect,
|
||||
fidohwmarks,
|
||||
msglistpagebar,
|
||||
|
@ -120,8 +120,10 @@ void Area::DeleteMsg(GMsg* msg, int direction) {
|
||||
if(isnet() and isfido())
|
||||
TouchNetscan(false);
|
||||
|
||||
// Remove message from internal table
|
||||
Msgn.Del(msg->msgno);
|
||||
if(not issmb() and not (isjam() and not CFG->switches.get(jamharddelete))) {
|
||||
// Remove message from internal table
|
||||
Msgn.Del(msg->msgno);
|
||||
}
|
||||
|
||||
// Update lastreads
|
||||
if(Msgn.Count())
|
||||
|
@ -427,7 +427,6 @@ int EditHeaderinfo(int mode, GMsgHeaderView &view) {
|
||||
|
||||
ChgAttrs(YES, msg);
|
||||
|
||||
whelpdef(CFG->helpged, Key_F1, C_HELPB, C_HELPW, C_HELPQ, C_HELPS, NULL);
|
||||
vcurshow();
|
||||
if(not (hedit.lookup or AA->isnet())) {
|
||||
char date2[25] = {""};
|
||||
|
@ -1033,7 +1033,7 @@ void Initialize(int argc, char* argv[]) {
|
||||
#ifndef GMB_NOJAM
|
||||
if(AL.msgbases & MT_JAM) {
|
||||
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
|
||||
#ifndef GMB_NOPCB
|
||||
|
@ -571,7 +571,6 @@ void ChgAttrs(int mode, GMsg* __msg) {
|
||||
}
|
||||
else {
|
||||
DispAttrWindow(false);
|
||||
freonkey();
|
||||
}
|
||||
}
|
||||
|
||||
@ -582,7 +581,6 @@ void AskAttributes(GMsg* __msg) {
|
||||
|
||||
ChgAttrs(ALWAYS, __msg);
|
||||
update_statusline(LNG->ChangeAttrs);
|
||||
whelpdef(CFG->helpged, Key_F1, C_HELPB, C_HELPW, C_HELPQ, C_HELPS, NULL);
|
||||
whelppcat(H_Attributes);
|
||||
|
||||
gkey key;
|
||||
|
@ -340,7 +340,6 @@ bool GMsgList::handle_key() {
|
||||
break;
|
||||
|
||||
case KK_ListGotoNext:
|
||||
listgotonext:
|
||||
key = Key_Dwn;
|
||||
default_handle_key();
|
||||
break;
|
||||
|
@ -444,6 +444,7 @@ public:
|
||||
int isjam() const;
|
||||
int ispcboard() const;
|
||||
int issquish() const;
|
||||
int issmb() const;
|
||||
int iswildcat() const;
|
||||
int isadeptxbbs() 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::ispcboard() const { return area->ispcboard(); }
|
||||
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::isadeptxbbs() const { return area->isadeptxbbs(); }
|
||||
inline int Area::isseparator() const { return area->isseparator(); }
|
||||
|
@ -132,6 +132,7 @@ public:
|
||||
int isjam() const;
|
||||
int ispcboard() const;
|
||||
int issquish() const;
|
||||
int issmb() const;
|
||||
int iswildcat() const;
|
||||
int isadeptxbbs() 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::ispcboard() const { return cfg.ispcboard(); }
|
||||
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::isadeptxbbs() const { return cfg.isadeptxbbs(); }
|
||||
inline int gmo_area::isseparator() const { return cfg.isseparator(); }
|
||||
|
@ -224,9 +224,11 @@ struct JamData {
|
||||
int fhjdt;
|
||||
int fhjdx;
|
||||
int fhjlr;
|
||||
int fhjhw; // highwater if available
|
||||
int islocked; // Area is locked?
|
||||
int timesposted;
|
||||
long lastpos; // Lastread position
|
||||
long lastpos; // Lastread position
|
||||
long highwater;
|
||||
JamLast lastrec; // .JLR Lastread record
|
||||
JamHdrInfo hdrinfo; // .JHR Header info record
|
||||
};
|
||||
@ -240,6 +242,7 @@ struct JamWide {
|
||||
int lookreplies;
|
||||
const char* jampath;
|
||||
int harddelete;
|
||||
int smapihw;
|
||||
};
|
||||
|
||||
|
||||
|
@ -54,7 +54,7 @@ void JamExit() {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
void JamInit(const char* jampath, int harddelete) {
|
||||
void JamInit(const char* jampath, int harddelete, int jamsmapihw) {
|
||||
|
||||
GFTRK("JamInit");
|
||||
|
||||
@ -63,6 +63,7 @@ void JamInit(const char* jampath, int harddelete) {
|
||||
|
||||
jamwide->jampath = jampath;
|
||||
jamwide->harddelete = harddelete;
|
||||
jamwide->smapihw = jamsmapihw;
|
||||
|
||||
// Calculate CRC32 of our username for the lastreads
|
||||
INam _name;
|
||||
|
@ -39,7 +39,7 @@ void JamArea::data_open() {
|
||||
|
||||
wide = jamwide;
|
||||
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->timesposted = 0;
|
||||
data->lastpos = 0;
|
||||
@ -102,6 +102,9 @@ void JamArea::raw_open() {
|
||||
sprintf(file, "%s.jlr", path()); data->fhjlr = test_open(file);
|
||||
if(NOT just_scanning) {
|
||||
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);
|
||||
@ -114,10 +117,11 @@ void JamArea::raw_close() {
|
||||
|
||||
GFTRK("JamArea::raw_close");
|
||||
|
||||
if(data->fhjlr != -1) ::close(data->fhjlr); data->fhjlr = -1;
|
||||
if(data->fhjdx != -1) ::close(data->fhjdx); data->fhjdx = -1;
|
||||
if(data->fhjdt != -1) ::close(data->fhjdt); data->fhjdt = -1;
|
||||
if(data->fhjhr != -1) ::close(data->fhjhr); data->fhjhr = -1;
|
||||
if(data->fhjlr != -1) { ::close(data->fhjlr); data->fhjlr = -1; }
|
||||
if(data->fhjdx != -1) { ::close(data->fhjdx); data->fhjdx = -1; }
|
||||
if(data->fhjdt != -1) { ::close(data->fhjdt); data->fhjdt = -1; }
|
||||
if(data->fhjhr != -1) { ::close(data->fhjhr); data->fhjhr = -1; }
|
||||
if(data->fhjhw != -1) { ::close(data->fhjhw); data->fhjhw = -1; }
|
||||
|
||||
GFTRK(NULL);
|
||||
}
|
||||
@ -136,6 +140,11 @@ void JamArea::open_area() {
|
||||
memset(&data->hdrinfo, 0, 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?
|
||||
if(memcmp(data->hdrinfo.signature, JAM_SIGNATURE, 4)) {
|
||||
|
||||
|
@ -69,6 +69,19 @@ void JamArea::lock() {
|
||||
lseekset(data->fhjhr, 0);
|
||||
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);
|
||||
}
|
||||
|
||||
@ -407,6 +420,18 @@ void JamArea::save_message(int __mode, gmsg* __msg, JamHdr& __hdr) {
|
||||
// Update internal array
|
||||
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 {
|
||||
scan();
|
||||
|
@ -135,7 +135,12 @@ Line* JamArea::make_dump_msg(Line*& lin, gmsg* __msg, char* lng_head) {
|
||||
AddLineF(line, "ActiveMsgs : %lu", _base->activemsgs);
|
||||
AddLineF(line, "PasswordCRC : %08lXh", _base->passwordcrc);
|
||||
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, "");
|
||||
AddLineF(line, "Subfields:");
|
||||
line = AddLine(line, "");
|
||||
|
@ -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 JamWideOpen();
|
||||
|
Reference in New Issue
Block a user