Various fixes. See notework.txt

This commit is contained in:
Alexander S. Aganichev
2001-10-07 08:24:26 +00:00
parent 07782be14d
commit f1ab267ad1
21 changed files with 97 additions and 41 deletions

View File

@@ -296,7 +296,7 @@ void AreaList::AddNewArea(AreaCfg* aa) {
// We had it already, so override with the new data
newarea = false;
if(strblank((*ap)->desc()))
strcpy(desc, aa->desc);
strxcpy(desc, aa->desc, sizeof(desc));
break;
}
}

View File

@@ -749,8 +749,9 @@ CfgGed::CfgGed() {
templatematch = false;
timeout = 0;
twitmode = TWIT_BLANK;
usearea = true;
usecharset = true;
usefwd = false;
usefwd = NO;
useintl = true;
usepid = true;
usernameno = 0;

View File

@@ -359,6 +359,7 @@ const word CRC_TWITMODE = 0x9DC8;
const word CRC_TWITNAME = 0x2055;
const word CRC_TWITSUBJ = 0x08C0;
const word CRC_TWITTO = 0x9DFE;
const word CRC_USEAREA = 0x2FD4;
const word CRC_USECHARSET = 0xE1B9;
const word CRC_USEFLAGS = 0xE2B6;
const word CRC_USEFWD = 0x439F;

View File

@@ -555,6 +555,7 @@ SwitchT:
SwitchU:
switch(crc) {
case CRC_USEAREA : CfgUsearea (); break;
case CRC_USECHARSET : CfgUsecharset (); break;
case CRC_USEFWD : CfgUsefwd (); break;
case CRC_USEINTL : CfgUseintl (); break;

View File

@@ -274,6 +274,17 @@ void CfgTwitsubj() {
// ------------------------------------------------------------------
void CfgUsearea() {
int flag = GetYesno(val) ? true : false;
if(cfgingroup)
CFG->grp.AddItm(GRP_USEAREA, flag);
else
CFG->usearea = flag;
}
// ------------------------------------------------------------------
void CfgUsecharset() {
CFG->usecharset = GetYesno(val);

View File

@@ -341,6 +341,7 @@ void CfgTwitmode ();
void CfgTwitname ();
void CfgTwitsubj ();
void CfgTwitto ();
void CfgUsearea ();
void CfgUsecharset ();
void CfgUseflags ();
void CfgUsefwd ();

View File

@@ -336,6 +336,7 @@ public:
int twitmode; // showtwits;
std::vector<Node> twitname;
gstrarray twitsubj;
bool usearea;
bool usecharset;
int usefwd;
bool useintl;

View File

@@ -41,7 +41,12 @@ bool strncont(const char *beginword, const char *stylestopchars, int n)
// ------------------------------------------------------------------
inline int isstylechar(char c) { return (c == '*') or (c == '/') or (c == '_') or (c == '#'); }
inline bool isstylechar(char c) {
if(strchr(CFG->stylecodestops, c) != NULL)
return false;
return (c == '*') or (c == '/') or (c == '_') or (c == '#');
}
void Container::StyleCodeHighlight(const char* text, int row, int col, bool dohide, int color) {

View File

@@ -2699,18 +2699,18 @@ void UndoStack::PlayItem() {
// we need to fit thisrow into the screen boundaries
if(delta > 0) {
for (row -= delta; row < minrow; row++) {
for (row -= delta; (int)row < (int)minrow; row++) {
if(templine) // cause refresh() issue an error since templine should never be NULL
templine = templine->next;
}
temprow = maxrow;
temprow = minrow;
}
else {
for (row -= delta; row > maxrow; row--) {
if(templine) // cause refresh() issue an error since templine should never be NULL
templine = templine->prev;
}
temprow = minrow;
temprow = maxrow;
}
// move pointer to the top of screen so we refresh scrolled area

View File

@@ -458,9 +458,11 @@ char* strxmimecpy(char* dest, const char* source, int level, int size, bool dete
static void KludgeAREA(GMsg* msg, const char* echoid) {
Area* ap = AL.AreaEchoToPtr(echoid);
if(ap)
msg->areakludgeid = ap->echoid();
if(AA->Usearea()) {
Area* ap = AL.AreaEchoToPtr(echoid);
if(ap)
msg->areakludgeid = ap->echoid();
}
}
@@ -815,7 +817,8 @@ static void KludgeX_FTN_TO(GMsg* msg, const char* ptr) {
static void KludgeFWDFROM(GMsg* msg, const char* ptr) {
strxcpy(msg->fwdfrom, ptr, sizeof(msg->fwdfrom));
if(AA->Usefwd())
strxcpy(msg->fwdfrom, ptr, sizeof(msg->fwdfrom));
}
@@ -823,7 +826,8 @@ static void KludgeFWDFROM(GMsg* msg, const char* ptr) {
static void KludgeFWDORIG(GMsg* msg, const char* ptr) {
msg->fwdorig.reset(ptr);
if(AA->Usefwd())
msg->fwdorig.reset(ptr);
}
@@ -831,7 +835,8 @@ static void KludgeFWDORIG(GMsg* msg, const char* ptr) {
static void KludgeFWDTO(GMsg* msg, const char* ptr) {
strxcpy(msg->fwdto, ptr, sizeof(msg->fwdto));
if(AA->Usefwd())
strxcpy(msg->fwdto, ptr, sizeof(msg->fwdto));
}
@@ -839,7 +844,8 @@ static void KludgeFWDTO(GMsg* msg, const char* ptr) {
static void KludgeFWDDEST(GMsg* msg, const char* ptr) {
msg->fwddest.reset(ptr);
if(AA->Usefwd())
msg->fwddest.reset(ptr);
}
@@ -847,7 +853,8 @@ static void KludgeFWDDEST(GMsg* msg, const char* ptr) {
static void KludgeFWDSUBJ(GMsg* msg, const char* ptr) {
strxcpy(msg->fwdsubj, ptr, sizeof(msg->fwdsubj));
if(AA->Usefwd())
strxcpy(msg->fwdsubj, ptr, sizeof(msg->fwdsubj));
}
@@ -855,7 +862,8 @@ static void KludgeFWDSUBJ(GMsg* msg, const char* ptr) {
static void KludgeFWDAREA(GMsg* msg, const char* ptr) {
strxcpy(msg->fwdarea, ptr, sizeof(msg->fwdarea));
if(AA->Usefwd())
strxcpy(msg->fwdarea, ptr, sizeof(msg->fwdarea));
}
@@ -863,7 +871,8 @@ static void KludgeFWDAREA(GMsg* msg, const char* ptr) {
static void KludgeFWDMSGID(GMsg* msg, const char* ptr) {
strxcpy(msg->fwdmsgid, ptr, sizeof(msg->fwdmsgid));
if(AA->Usefwd())
strxcpy(msg->fwdmsgid, ptr, sizeof(msg->fwdmsgid));
}
@@ -1462,9 +1471,7 @@ void ScanKludges(GMsg* msg, int getvalue) {
line->type |= GLINE_KLUD;
const char* areakludgeptr = ptr+5; // Extract echoid from kludge
areakludgeptr = strskip_wht(areakludgeptr);
Area* ap = AL.AreaEchoToPtr(areakludgeptr);
if(ap)
msg->areakludgeid = ap->echoid();
KludgeAREA(msg, areakludgeptr);
}
if(not (line->type & GLINE_KLUD)) {

View File

@@ -90,13 +90,6 @@ int Area::LoadMsg(GMsg* msg, ulong msgno, int margin, int mode) {
if(not (msg->attr.uns() and not msg->attr.rcv()))
return true;
}
else {
// We can't rely on the destination address unless we are in netmail
if(not AA->isnet()) {
msg->dest.reset_fast();
msg->odest.reset_fast();
}
}
msg->attr.tou0();
msg->TextToLines(margin);
return true;

View File

@@ -25,6 +25,7 @@
// ------------------------------------------------------------------
#include <golded.h>
#include <gcharset.h>
// ------------------------------------------------------------------
@@ -732,7 +733,7 @@ void GThreadlist::GenTree(char* buf, int idx) {
if(graph[0] == NUL) {
int table = LoadCharset(NULL, NULL, 1);
int level = LoadCharset("IBMPC", CFG->xlatlocalset);
int level = LoadCharset(get_dos_charset(CFG->xlatlocalset), CFG->xlatlocalset);
XlatStr(graph, graph_ibmpc, level, CharTable);
if(table == -1)
LoadCharset(CFG->xlatimport, CFG->xlatlocalset);

View File

@@ -763,6 +763,7 @@ void MakeMsg(int mode, GMsg* omsg, bool ignore_replyto) {
msg->references = NULL;
msg->attr.tou0();
msg->TextToLines(CFG->dispmargin-1, false);
msg->msgid.reset();
*msg->iorig = NUL;
*msg->idest = NUL;
*msg->ireplyto = NUL;

View File

@@ -168,6 +168,7 @@ void Area::InitData() {
strxcpy(adat->wtpl, CFG->wtpl.c_str(), sizeof(adat->wtpl));
adat->templatematch = CFG->templatematch;
adat->twitmode = CFG->twitmode;
adat->usearea = CFG->usearea;
adat->usefwd = CFG->usefwd;
strcpy(adat->username.name, CFG->username.empty() ? "" : CFG->username[CFG->usernameno].name);
adat->username.addr = adat->aka.addr;
@@ -319,6 +320,7 @@ void Area::RandomizeData(int mode) {
CFG->grp.GetItm(GRP_TEMPLATEMATCH, adat->templatematch);
CFG->grp.GetItm(GRP_TWITMODE, adat->twitmode);
CFG->grp.GetItm(GRP_USEAREA, adat->usearea);
CFG->grp.GetItm(GRP_USEFWD, adat->usefwd);
if(CFG->grp.GetItm(GRP_USERNAME, buf, sizeof(buf))) {

View File

@@ -1015,11 +1015,11 @@ void OtherAreaReplyMsg() {
void ReplyMsg() {
if(CurrArea == OrigArea) {
const char *destarea = AA->Areareplyto();
if (!*destarea)
destarea = reader_msg->areakludgeid;
const char *destarea = reader_msg->areakludgeid;
if ((destarea != NULL) and (*destarea != NUL))
destarea = AA->Areareplyto();
if(AA->Areareplydirect() and destarea) {
if(AA->Areareplydirect() and (destarea != NULL)) {
int a = AL.AreaEchoToNo(destarea);
if(a != -1) {
CurrArea = AL.AreaNoToId(a);
@@ -1051,11 +1051,11 @@ void ReplyMsg() {
void QuoteMsg(bool ignore_replyto) {
if(CurrArea == OrigArea) {
const char *destarea = AA->Areareplyto();
if (!*destarea)
destarea = reader_msg->areakludgeid;
const char *destarea = reader_msg->areakludgeid;
if ((destarea != NULL) and (*destarea != NUL))
destarea = AA->Areareplyto();
if(AA->Areareplydirect() and destarea) {
if(AA->Areareplydirect() and (destarea != NULL)) {
int a = AL.AreaEchoToNo(destarea);
if(a != -1) {
CurrArea = AL.AreaNoToId(a);
@@ -1087,11 +1087,11 @@ void QuoteMsg(bool ignore_replyto) {
void CommentMsg() {
if(CurrArea == OrigArea) {
const char *destarea = AA->Areareplyto();
if (!*destarea)
destarea = reader_msg->areakludgeid;
const char *destarea = reader_msg->areakludgeid;
if ((destarea != NULL) and (*destarea != NUL))
destarea = AA->Areareplyto();
if(AA->Areareplydirect() && destarea) {
if(AA->Areareplydirect() and (destarea != NULL)) {
int a = AL.AreaEchoToNo(destarea);
if(a != -1) {
CurrArea = AL.AreaNoToId(a);

View File

@@ -306,6 +306,7 @@ struct AreaData {
Tear tearline;
Path tpl;
bool templatematch;
bool usearea;
int usefwd;
Node username;
bool usetzutc;
@@ -564,6 +565,7 @@ public:
const char* Tpl() const { return adat->tpl; }
bool Templatematch() const { return adat->templatematch; }
int Twitmode() const { return adat->twitmode; }
bool Usearea() const { return adat->usearea; }
int Usefwd() const { return adat->usefwd; }
const Node& Username() const { return adat->username; }
bool Usetzutc() const { return adat->usetzutc; }