This commit is contained in:
Alexander S. Aganichev 2001-04-08 08:02:01 +00:00
parent b3cf864163
commit 54e47b7b0a
6 changed files with 128 additions and 69 deletions

View File

@ -9,16 +9,24 @@ ______________________________________________________________________
______________________________________________________________________ ______________________________________________________________________
Notes for GoldED+ 1.1.5, March xx 2001 Notes for GoldED+ 1.1.5, April xx 2001
______________________________________________________________________ ______________________________________________________________________
- Fixed cursor position in XlatImport menu when Auto encoding
selected.
- Added support for CommentChar token in FidoConfig (untested).
- Added code for trimming particular subfields in JAM as required by
JAM specification.
- Fixed users.bbs handling for *.msg and Squish areas. - Fixed users.bbs handling for *.msg and Squish areas.
- Soft-deleted messages no longer hidden from messagelist right after - Soft-deleted messages no longer hidden from messagelist right after
deletion any more. deletion any more.
+ Added new switch JamSMAPIHighwater. If defined GoldED+ will handle + Added new switch JamSMAPIHighwater. If defined GoldED+ will handle
highwaters just like SMAPI did. Recommended for use with HPT. highwaters just like SMAPI do. Recommended for use with HPT.
Defaults to No. Support for Crashmail II style highwaters added as Defaults to No. Support for Crashmail II style highwaters added as
well. well.

View File

@ -905,7 +905,7 @@ int ChangeXlatImport() {
if(strieql(xlt->exp, CFG->xlatlocalset)) { if(strieql(xlt->exp, CFG->xlatlocalset)) {
maximport = MaxV(maximport, (int)strlen(xlt->imp)); maximport = MaxV(maximport, (int)strlen(xlt->imp));
maxexport = MaxV(maxexport, (int)strlen(xlt->exp)); maxexport = MaxV(maxexport, (int)strlen(xlt->exp));
if(strieql(xlt->imp, AA->Xlatimport())) if((CFG->ignorecharset == true) and strieql(xlt->imp, AA->Xlatimport()))
startat = xlatimports; startat = xlatimports;
xlatimports++; xlatimports++;
} }

View File

@ -195,8 +195,10 @@ void GMsgList::do_delayed() {
wactiv_(mlstwh); wactiv_(mlstwh);
} }
if(CFG->switches.get(msglistviewsubj)) if(CFG->switches.get(msglistviewsubj)) {
wtitle(msg.re, TCENTER|TBOTTOM, tattr); ReadMlst(index);
wtitle(mlst[index].re, TCENTER|TBOTTOM, tattr);
}
if(CFG->switches.get(msglistpagebar)) if(CFG->switches.get(msglistpagebar))
wscrollbar(W_VERT, maximum_index+1, maximum_index, index); wscrollbar(W_VERT, maximum_index+1, maximum_index, index);

View File

@ -35,7 +35,7 @@
// ------------------------------------------------------------------ // ------------------------------------------------------------------
static bool lame = false; static bool lame = false;
static bool comment_char = '#';
// ------------------------------------------------------------------ // ------------------------------------------------------------------
@ -64,59 +64,70 @@ bool gareafile::ReadHPTLine(FILE* f, string* s, bool add, int state) {
// 2: end // 2: end
// 3: whitespace // 3: whitespace
while((ptr != str.end()) and (state != 2)) { while((ptr != str.end()) and (state != 2)) {
switch(*ptr) { if(*ptr == comment_char) {
case '\\': if(state != 1) {
if(lame) str.erase(ptr, str.end());
break; state = 2;
if(ptr == str.end()-1) { }
str.erase(ptr); }
const char *p = strskip_wht(str.c_str()); else {
if(add) switch(*ptr) {
*s += p; case '\\':
else if(lame)
*s = p; break;
ReadHPTLine(f, s, true, state); if(ptr == str.end()-1) {
return true; str.erase(ptr);
} else const char *p = strskip_wht(str.c_str());
switch(ptr[1]) { if(add)
case ' ': *s += p;
case '\t': else
{ *s = p;
string::iterator i = ptr; ReadHPTLine(f, s, true, state);
while((i != str.end()) and isspace(*i)) return true;
++i; } else
if(*i != '#') if(ptr[1] == comment_char) {
break;
}
case '#':
case NUL:
case '\n':
str.erase(ptr, str.end()); str.erase(ptr, str.end());
{ const char *p = strskip_wht(str.c_str());
const char *p = strskip_wht(str.c_str()); if(add)
if(add) *s += p;
*s += p; else
else *s = p;
*s = p;
}
ReadHPTLine(f, s, true, state); ReadHPTLine(f, s, true, state);
return true; return true;
default: }
break; switch(ptr[1]) {
} case ' ':
++ptr; case '\t':
break; {
case '\"': string::iterator i = ptr;
state = 1; while((i != str.end()) and isspace(*i))
break; ++i;
case '#': if(*i != '#')
if(state != 1) { break;
str.erase(ptr, str.end()); }
state = 2; case NUL:
} case '\n':
break; str.erase(ptr, str.end());
default: {
break; const char *p = strskip_wht(str.c_str());
if(add)
*s += p;
else
*s = p;
}
ReadHPTLine(f, s, true, state);
return true;
default:
break;
}
++ptr;
break;
case '\"':
state = 1;
break;
default:
break;
}
} }
++ptr; ++ptr;
} }
@ -241,6 +252,7 @@ void gareafile::ReadHPTFile(char* path, char* file, char* options, char* origin,
const word CRC_BADAREA = 0x8DA5; const word CRC_BADAREA = 0x8DA5;
const word CRC_SYSOP = 0x967F; const word CRC_SYSOP = 0x967F;
const word CRC_VERSION = 0xF78F; const word CRC_VERSION = 0xF78F;
const word CRC_COMMENTCHAR = 0xE2CC;
AreaCfg aa; AreaCfg aa;
Path buf2; Path buf2;
@ -294,6 +306,13 @@ void gareafile::ReadHPTFile(char* path, char* file, char* options, char* origin,
MakePathname(buf2, path, buf2); MakePathname(buf2, path, buf2);
ReadHPTFile(path, buf2, options, origin, group); ReadHPTFile(path, buf2, options, origin, group);
break; break;
case CRC_COMMENTCHAR:
replace_slashes(&val);
if((strlen(val) == 3) and (val[0] == val[2]) and strpbrk(val, "\'\""))
comment_char = val[1];
else if(*val)
comment_char = val[0];
break;
case CRC_NETAREA: case CRC_NETAREA:
aa.type = GMB_NET; aa.type = GMB_NET;
break; break;

View File

@ -118,7 +118,27 @@
#define JAMSUB_PATH2D 2002 #define JAMSUB_PATH2D 2002
#define JAMSUB_FLAGS 2003 #define JAMSUB_FLAGS 2003
#define JAMSUB_TZUTCINFO 2004 #define JAMSUB_TZUTCINFO 2004
#define JAMSUB_UNKNOWN 0xFFFF
#define JAMSUB_OADDRESS_LEN 100
#define JAMSUB_DADDRESS_LEN 100
#define JAMSUB_SENDERNAME_LEN 100
#define JAMSUB_RECEIVERNAME_LEN 100
#define JAMSUB_MSGID_LEN 100
#define JAMSUB_REPLYID_LEN 100
#define JAMSUB_SUBJECT_LEN 100
#define JAMSUB_PID_LEN 40
#define JAMSUB_TRACE_LEN ((ulong)(-1))
#define JAMSUB_ENCLOSEDFILE_LEN ((ulong)(-1))
#define JAMSUB_ENCLOSEDFILEWALIAS_LEN ((ulong)(-1))
#define JAMSUB_ENCLOSEDFREQ_LEN ((ulong)(-1))
#define JAMSUB_ENCLOSEDFILEWCARD_LEN ((ulong)(-1))
#define JAMSUB_ENCLOSEDINDIRECFILE_LEN ((ulong)(-1))
#define JAMSUB_EMBINDAT_LEN ((ulong)(-1))
#define JAMSUB_FTSKLUDGE_LEN 255
#define JAMSUB_SEENBY2D_LEN ((ulong)(-1))
#define JAMSUB_PATH2D_LEN ((ulong)(-1))
#define JAMSUB_FLAGS_LEN ((ulong)(-1))
#define JAMSUB_TZUTCINFO_LEN ((ulong)(-1))
// ------------------------------------------------------------------ // ------------------------------------------------------------------
@ -273,7 +293,7 @@ protected:
int load_message(int __mode, gmsg* __msg, JamHdr& __hdr); int load_message(int __mode, gmsg* __msg, JamHdr& __hdr);
void add_subfield(JamHdr& __hdr, byte*& __subfield, word __loid, word __hiid, char* __data); void add_subfield(JamHdr& __hdr, byte*& __subfield, word __loid, word __hiid, char* __data, ulong maxlen);
void save_message(int __mode, gmsg* __msg, JamHdr& __hdr); void save_message(int __mode, gmsg* __msg, JamHdr& __hdr);

View File

@ -103,16 +103,16 @@ void JamArea::unlock() {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
void JamArea::add_subfield(JamHdr& __hdr, byte*& __subfield, word __loid, word __hiid, char* __data) { void JamArea::add_subfield(JamHdr& __hdr, byte*& __subfield, word __loid, word __hiid, char* __data, ulong __maxlen) {
uint _datlen = strlen(__data); ulong _datlen = strlen(__data);
__subfield = (byte*)throw_realloc(__subfield, (uint)__hdr.subfieldlen+sizeof(JamSubFieldHdr)+_datlen); __subfield = (byte*)throw_realloc(__subfield, (uint)__hdr.subfieldlen+sizeof(JamSubFieldHdr)+_datlen);
JamSubField* _subfieldptr = (JamSubField*)(__subfield + (uint)__hdr.subfieldlen); JamSubField* _subfieldptr = (JamSubField*)(__subfield + (uint)__hdr.subfieldlen);
_subfieldptr->loid = __loid; _subfieldptr->loid = __loid;
_subfieldptr->hiid = __hiid; _subfieldptr->hiid = __hiid;
_subfieldptr->datlen = _datlen; _subfieldptr->datlen = MinV(_datlen, __maxlen);
memcpy(_subfieldptr->buffer, __data, _datlen); memcpy(_subfieldptr->buffer, __data, _subfieldptr->datlen);
__hdr.subfieldlen += sizeof(JamSubFieldHdr) + _datlen; __hdr.subfieldlen += sizeof(JamSubFieldHdr) + _subfieldptr->datlen;
} }
@ -196,23 +196,23 @@ void JamArea::save_message(int __mode, gmsg* __msg, JamHdr& __hdr) {
} }
if(*__msg->by) if(*__msg->by)
add_subfield(__hdr, _subfield, JAMSUB_SENDERNAME, 0, __msg->by); add_subfield(__hdr, _subfield, JAMSUB_SENDERNAME, 0, __msg->by, JAMSUB_SENDERNAME_LEN);
if(__msg->orig.net) { if(__msg->orig.net) {
__msg->orig.make_string(_buf, __msg->odom); __msg->orig.make_string(_buf, __msg->odom);
add_subfield(__hdr, _subfield, JAMSUB_OADDRESS, 0, _buf); add_subfield(__hdr, _subfield, JAMSUB_OADDRESS, 0, _buf, JAMSUB_OADDRESS_LEN);
} }
if(*__msg->to) if(*__msg->to)
add_subfield(__hdr, _subfield, JAMSUB_RECEIVERNAME, 0, __msg->to); add_subfield(__hdr, _subfield, JAMSUB_RECEIVERNAME, 0, __msg->to, JAMSUB_RECEIVERNAME_LEN);
if(__msg->dest.net) { if(__msg->dest.net) {
__msg->dest.make_string(_buf, __msg->ddom); __msg->dest.make_string(_buf, __msg->ddom);
add_subfield(__hdr, _subfield, JAMSUB_DADDRESS, 0, _buf); add_subfield(__hdr, _subfield, JAMSUB_DADDRESS, 0, _buf, JAMSUB_DADDRESS_LEN);
} }
if(*__msg->re) if(*__msg->re)
add_subfield(__hdr, _subfield, JAMSUB_SUBJECT, 0, __msg->re); add_subfield(__hdr, _subfield, JAMSUB_SUBJECT, 0, __msg->re, JAMSUB_SUBJECT_LEN);
// Convert kludges // Convert kludges
_line = 0; _line = 0;
@ -221,6 +221,7 @@ void JamArea::save_message(int __mode, gmsg* __msg, JamHdr& __hdr) {
if(_pdptr->control > CTRL_KLUDGE) { if(_pdptr->control > CTRL_KLUDGE) {
uint _offset = 0; uint _offset = 0;
word _loid = 0; word _loid = 0;
ulong _maxlen = 0;
switch(_pdptr->control) { switch(_pdptr->control) {
case CTRL_INTL: case CTRL_INTL:
case CTRL_FMPT: case CTRL_FMPT:
@ -229,44 +230,53 @@ void JamArea::save_message(int __mode, gmsg* __msg, JamHdr& __hdr) {
break; break;
case CTRL_MSGID: case CTRL_MSGID:
_loid = JAMSUB_MSGID; _loid = JAMSUB_MSGID;
_maxlen = JAMSUB_MSGID_LEN;
_offset = 8; _offset = 8;
strxcpy(__msg->msgids, _pdptr->text+_offset, sizeof(__msg->msgids)); strxcpy(__msg->msgids, _pdptr->text+_offset, sizeof(__msg->msgids));
break; break;
case CTRL_REPLY: case CTRL_REPLY:
_loid = JAMSUB_REPLYID; _loid = JAMSUB_REPLYID;
_maxlen = JAMSUB_REPLYID_LEN;
_offset = 8; _offset = 8;
strxcpy(__msg->replys, _pdptr->text+_offset, sizeof(__msg->replys)); strxcpy(__msg->replys, _pdptr->text+_offset, sizeof(__msg->replys));
break; break;
case CTRL_PID: case CTRL_PID:
_loid = JAMSUB_PID; _loid = JAMSUB_PID;
_maxlen = JAMSUB_PID_LEN;
_offset = 6; _offset = 6;
break; break;
case CTRL_VIA: case CTRL_VIA:
_loid = JAMSUB_TRACE; _loid = JAMSUB_TRACE;
_maxlen = JAMSUB_TRACE_LEN;
_offset = 6; _offset = 6;
break; break;
case CTRL_SEENBY: case CTRL_SEENBY:
_loid = JAMSUB_SEENBY2D; _loid = JAMSUB_SEENBY2D;
_maxlen = JAMSUB_SEENBY2D_LEN;
_offset = 9; _offset = 9;
break; break;
case CTRL_SEENBY1: case CTRL_SEENBY1:
_loid = JAMSUB_SEENBY2D; _loid = JAMSUB_SEENBY2D;
_maxlen = JAMSUB_SEENBY2D_LEN;
_offset = 10; _offset = 10;
break; break;
case CTRL_PATH: case CTRL_PATH:
_loid = JAMSUB_PATH2D; _loid = JAMSUB_PATH2D;
_maxlen = JAMSUB_PATH2D_LEN;
_offset = 7; _offset = 7;
break; break;
case CTRL_FLAGS: case CTRL_FLAGS:
_loid = JAMSUB_FLAGS; _loid = JAMSUB_FLAGS;
_maxlen = JAMSUB_FLAGS_LEN;
_offset = 7; _offset = 7;
break; break;
default: default:
_loid = JAMSUB_FTSKLUDGE; _loid = JAMSUB_FTSKLUDGE;
_maxlen = JAMSUB_FTSKLUDGE_LEN;
_offset = 1; _offset = 1;
} }
if(_offset) if(_offset)
add_subfield(__hdr, _subfield, _loid, 0, _pdptr->text+_offset); add_subfield(__hdr, _subfield, _loid, 0, _pdptr->text+_offset, _maxlen);
} }
_pdptr++; _pdptr++;
_line++; _line++;