various fixes
This commit is contained in:
@@ -951,7 +951,7 @@ int ReadKeysCfg(int force) {
|
||||
while(*ptr) {
|
||||
if(*ptr == '\"') { // Start of literal string
|
||||
ptr++;
|
||||
while(*ptr != '\"' and n < 79) {
|
||||
while((*ptr != '\"') and (n < (sizeof(tmp2.buf)/sizeof(gkey)))) {
|
||||
ch = *ptr++;
|
||||
tmp2.buf[n++] = (gkey)(ch | (scancode(ch) << 8));
|
||||
}
|
||||
@@ -964,7 +964,7 @@ int ReadKeysCfg(int force) {
|
||||
int tmpkt;
|
||||
keycmd = SwitchKeyDefs(strCrc16(strupr(ptr2)), &tmpkt);
|
||||
if(keycmd) {
|
||||
if(n < 79)
|
||||
if(n < (sizeof(tmp2.buf)/sizeof(gkey)))
|
||||
tmp2.buf[n++] = (gkey)keycmd;
|
||||
}
|
||||
else {
|
||||
|
@@ -113,7 +113,7 @@ void IEclass::setlinetype(Line* __line) {
|
||||
|
||||
int IEclass::dispchar(vchar __ch, int attr) {
|
||||
|
||||
if(__ch == '\0') // possible if line empty
|
||||
if(__ch == NUL) // possible if line empty
|
||||
__ch = ' ';
|
||||
if(__ch != '\n') {
|
||||
if(__ch == ' ')
|
||||
|
@@ -256,7 +256,7 @@ void CfgInit2() {
|
||||
|
||||
bool inline samekey(gkey key1, gkey key2) {
|
||||
|
||||
if(key1 > 0xff) // special key
|
||||
if(key1 >= KK_Commands) // special key
|
||||
return false;
|
||||
return (tolower(key1) == key2) or (toupper(key1) == key2);
|
||||
}
|
||||
|
@@ -1609,7 +1609,7 @@ void ScanKludges(GMsg* msg, int getvalue) {
|
||||
const char* ptr = line->txt.c_str() + 9;
|
||||
ptr = strskip_wht(ptr);
|
||||
char* tmp = UnwrapLine(line, ptr);
|
||||
KludgeREPLYADDR(msg, tmp ? tmp : ptr);
|
||||
KludgeREPLY_TO(msg, tmp ? tmp : ptr);
|
||||
if(tmp)
|
||||
throw_free(tmp);
|
||||
}
|
||||
@@ -2639,16 +2639,17 @@ void MsgLineReIndex(GMsg* msg, int viewhidden, int viewkludge, int viewquote) {
|
||||
if(not viewquote) {
|
||||
GetQuotestr(line->txt.c_str(), qbuf, &qlen);
|
||||
strtrim(qbuf);
|
||||
if(strieql(qbuf0, qbuf)) {
|
||||
if(strpbrk(line->txt.c_str()+qlen, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"))
|
||||
qmatches++;
|
||||
}
|
||||
else {
|
||||
if(not strieql(qbuf0, qbuf)) {
|
||||
strcpy(qbuf0, qbuf);
|
||||
if(strpbrk(line->txt.c_str()+qlen, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"))
|
||||
qmatches = 1;
|
||||
else
|
||||
qmatches = 0;
|
||||
qmatches = 0;
|
||||
}
|
||||
const char *p = line->txt.c_str()+qlen;
|
||||
while(*p != NUL) {
|
||||
if(isxalnum(*p)) {
|
||||
qmatches++;
|
||||
break;
|
||||
}
|
||||
++p;
|
||||
}
|
||||
if(qmatches != 1) {
|
||||
line = line->next;
|
||||
@@ -2977,6 +2978,8 @@ char* ParseInternetAddr(char* __string, char* __name, char* __addr) {
|
||||
|
||||
StripQuotes(__name);
|
||||
|
||||
strxmimecpy(__name, __name, 0, strlen(__name), true);
|
||||
|
||||
return __name;
|
||||
}
|
||||
|
||||
|
@@ -868,6 +868,23 @@ void GThreadlist::close() {
|
||||
|
||||
void GThreadlist::GenTree(char* buf, int idx) {
|
||||
|
||||
#ifdef KOI8
|
||||
static char graph[4]="<EFBFBD><EFBFBD><EFBFBD>";
|
||||
#else
|
||||
static char graph_ibmpc[4]="<EFBFBD><EFBFBD><EFBFBD>";
|
||||
static char graph[]="";
|
||||
|
||||
if(graph[0] == NUL) {
|
||||
int table = LoadCharset(NULL, NULL, 1);
|
||||
int level = LoadCharset("IBMPC", CFG->xlatlocalset);
|
||||
XlatStr(graph, graph_ibmpc, level, CharTable);
|
||||
if(table == -1)
|
||||
LoadCharset(CFG->xlatimport, CFG->xlatlocalset);
|
||||
else
|
||||
LoadCharset(CFG->xlatcharset[table].imp, CFG->xlatcharset[table].exp);
|
||||
}
|
||||
#endif
|
||||
|
||||
t = list[idx];
|
||||
|
||||
uint level = 0;
|
||||
@@ -875,7 +892,7 @@ void GThreadlist::GenTree(char* buf, int idx) {
|
||||
|
||||
*q-- = NUL;
|
||||
*q-- = ' ';
|
||||
*q-- = (t.replynext) ? '<EFBFBD>' : '<EFBFBD>';
|
||||
*q-- = (t.replynext) ? graph[0] : graph[1];
|
||||
|
||||
while(t.replyto) {
|
||||
for(uint i=0; i<list.size(); i++) {
|
||||
@@ -886,7 +903,7 @@ void GThreadlist::GenTree(char* buf, int idx) {
|
||||
}
|
||||
}
|
||||
*q-- = ' ';
|
||||
*q-- = (t.replynext) ? '<EFBFBD>' : ' ';
|
||||
*q-- = (t.replynext) ? graph[2] : ' ';
|
||||
}
|
||||
|
||||
t = list[idx];
|
||||
|
@@ -102,16 +102,17 @@ char* TokenXlat(int mode, char* input, GMsg* msg, GMsg* oldmsg, int __origarea)
|
||||
char xmailer[356];
|
||||
get_informative_string(xmailer);
|
||||
|
||||
struct tm* written_tm = gmtime(&msg->written);
|
||||
char cdate[32];
|
||||
strftimei(cdate, 32, LNG->DateFmt, written_tm);
|
||||
char ctime[32];
|
||||
strftimei(ctime, 32, LNG->TimeFmt, written_tm);
|
||||
time_t t = time(NULL);
|
||||
struct tm* written_tm = localtime(&t);
|
||||
char cdate[80];
|
||||
strftimei(cdate, 80, LNG->DateFmt, written_tm);
|
||||
char ctime[80];
|
||||
strftimei(ctime, 80, LNG->TimeFmt, written_tm);
|
||||
written_tm = gmtime(&oldmsg->written);
|
||||
char odate[32];
|
||||
strftimei(odate, 32, LNG->DateFmt, written_tm);
|
||||
char otime[32];
|
||||
strftimei(otime, 32, LNG->TimeFmt, written_tm);
|
||||
char odate[80];
|
||||
strftimei(odate, 80, LNG->DateFmt, written_tm);
|
||||
char otime[80];
|
||||
strftimei(otime, 80, LNG->TimeFmt, written_tm);
|
||||
|
||||
const char* osslashbuf = __gver_platform__;
|
||||
|
||||
@@ -120,7 +121,7 @@ char* TokenXlat(int mode, char* input, GMsg* msg, GMsg* oldmsg, int __origarea)
|
||||
bool currareaisinet = AA->isinternet();
|
||||
char* modereptr = oldmsg->re;
|
||||
|
||||
if(mode == MODE_QUOTE or mode == MODE_REPLYCOMMENT or mode == MODE_REPLY) {
|
||||
if((mode == MODE_QUOTE) or (mode == MODE_REPLYCOMMENT) or (mode == MODE_REPLY)) {
|
||||
if(AL.AreaIdToPtr(__origarea)->Areareplydirect() and oldmsg->areakludgeid)
|
||||
origareaid = oldmsg->areakludgeid;
|
||||
}
|
||||
@@ -309,7 +310,7 @@ char* TokenXlat(int mode, char* input, GMsg* msg, GMsg* oldmsg, int __origarea)
|
||||
tokenxchg(dst, "@fpseudo", msg->pseudofrom);
|
||||
continue;
|
||||
}
|
||||
if(tokenxchg(dst, "@cpseudo", *AA->Nickname() ? AA->Nickname() : strlword(strcpy(buf, AA->Username().name))))
|
||||
if(tokenxchg(dst, "@cpseudo", *AA->Nickname() ? AA->Nickname() : strlword(strcpy(buf, AA->Username().name), " @")))
|
||||
continue;
|
||||
if(tokenxchg(dst, "@version", longverbuf))
|
||||
continue;
|
||||
|
@@ -687,7 +687,7 @@ static void GetLastLink(GMsg* msg, ulong& msgno) {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
void MakeMsg(int mode, GMsg* omsg) {
|
||||
void MakeMsg(int mode, GMsg* omsg, bool ignore_replyto) {
|
||||
|
||||
GFTRK("MakeMsg");
|
||||
|
||||
@@ -833,6 +833,8 @@ void MakeMsg(int mode, GMsg* omsg) {
|
||||
case MODE_REPLYCOMMENT:
|
||||
omsg->attr.tou0();
|
||||
omsg->TextToLines(-CFG->quotemargin, false);
|
||||
if(ignore_replyto)
|
||||
omsg->ireplyto[0] = NUL;
|
||||
if(omsg->attr.rot())
|
||||
Rot13(omsg);
|
||||
// Drop through
|
||||
|
@@ -255,7 +255,7 @@ bool set_to_address(GMsg* msg, gsetaddr* toname, gsetaddr* toaddr, gsetaddr* fro
|
||||
// ------------------------------------------------------------------
|
||||
// GEPOST prototypes
|
||||
|
||||
void MakeMsg(int mode, GMsg* oldmsg);
|
||||
void MakeMsg(int mode, GMsg* oldmsg, bool ignore_replyto=false);
|
||||
int EditHeaderinfo(int mode, GMsgHeaderView &view);
|
||||
void CheckSubject(GMsg* msg, char* subj);
|
||||
|
||||
@@ -315,13 +315,11 @@ void MarkingOptions();
|
||||
void MessageBrowse();
|
||||
void NewArea(bool jumpnext = false);
|
||||
void NewMsg();
|
||||
void OtherAreaQuoteMsg();
|
||||
void OtherAreaDirQuoteMsg();
|
||||
void OtherAreaQuoteMsg(bool ignore_replyto=false);
|
||||
void OtherAreaCommentMsg();
|
||||
void QuitNow();
|
||||
void QuoteBuf(GMsg* msg);
|
||||
void DirQuoteMsg();
|
||||
void QuoteMsg();
|
||||
void QuoteMsg(bool ignore_replyto=false);
|
||||
void RenumberArea();
|
||||
void ReplyMsg();
|
||||
void ToggleBookMark();
|
||||
|
@@ -602,11 +602,11 @@ void Reader() {
|
||||
break;
|
||||
|
||||
case KK_ReadMoveQuoteMsg:
|
||||
OtherAreaQuoteMsg();
|
||||
OtherAreaQuoteMsg(false);
|
||||
break;
|
||||
|
||||
case KK_ReadMoveDirQuoteMsg:
|
||||
OtherAreaDirQuoteMsg();
|
||||
OtherAreaQuoteMsg(true);
|
||||
break;
|
||||
|
||||
case KK_ReadMoveCommentMsg:
|
||||
@@ -618,11 +618,11 @@ void Reader() {
|
||||
break;
|
||||
|
||||
case KK_ReadQuoteMsg:
|
||||
QuoteMsg();
|
||||
QuoteMsg(false);
|
||||
break;
|
||||
|
||||
case KK_ReadDirQuoteMsg:
|
||||
DirQuoteMsg();
|
||||
QuoteMsg(true);
|
||||
break;
|
||||
|
||||
case KK_ReadCommentMsg:
|
||||
|
@@ -252,13 +252,13 @@ int TemplateToText(int mode, GMsg* msg, GMsg* oldmsg, const char* tpl, int origa
|
||||
|
||||
// build @tpseudo
|
||||
if(is_user(msg->to))
|
||||
strcpy(msg->pseudoto, *AA->Nickname() ? AA->Nickname() : strlword(msg->to));
|
||||
strcpy(msg->pseudoto, *AA->Nickname() ? AA->Nickname() : strlword(msg->to, " @"));
|
||||
else
|
||||
*(msg->pseudoto) = NUL;
|
||||
|
||||
// build @fpseudo
|
||||
if(is_user(msg->By()))
|
||||
strcpy(msg->pseudofrom, *AA->Nickname() ? AA->Nickname() : strlword(msg->By()));
|
||||
strcpy(msg->pseudofrom, *AA->Nickname() ? AA->Nickname() : strlword(msg->By(), " @"));
|
||||
else
|
||||
*(msg->pseudofrom) = NUL;
|
||||
|
||||
@@ -944,16 +944,7 @@ void ReplyMsg() {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
void DirQuoteMsg() {
|
||||
|
||||
if(reader_msg->ireplyto) *reader_msg->ireplyto = NUL;
|
||||
QuoteMsg();
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
void QuoteMsg() {
|
||||
void QuoteMsg(bool ignore_replyto) {
|
||||
|
||||
if(CurrArea == OrigArea) {
|
||||
if(AA->Areareplydirect() and reader_msg->areakludgeid) {
|
||||
@@ -978,7 +969,7 @@ void QuoteMsg() {
|
||||
reader_keyok = not MenuReadonly.Run();
|
||||
}
|
||||
if(not reader_keyok)
|
||||
MakeMsg(MODE_QUOTE, reader_msg);
|
||||
MakeMsg(MODE_QUOTE, reader_msg, ignore_replyto);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1017,16 +1008,7 @@ void CommentMsg() {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
void OtherAreaDirQuoteMsg() {
|
||||
|
||||
if(reader_msg->ireplyto) *reader_msg->ireplyto = NUL;
|
||||
OtherAreaQuoteMsg();
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
void OtherAreaQuoteMsg() {
|
||||
void OtherAreaQuoteMsg(bool ignore_replyto) {
|
||||
|
||||
if(AA->Msgn.Count()) {
|
||||
int destarea = CurrArea;
|
||||
@@ -1063,7 +1045,7 @@ void OtherAreaQuoteMsg() {
|
||||
AA->adat->viewquote = adat_viewquote;
|
||||
}
|
||||
}
|
||||
QuoteMsg();
|
||||
QuoteMsg(ignore_replyto);
|
||||
if(CurrArea != OrigArea) {
|
||||
AA->Close();
|
||||
AL.SetActiveAreaId(OrigArea);
|
||||
|
@@ -848,7 +848,7 @@ bool guserbase::lookup_addressbook(GMsg* msg, char* name, char* aka, bool browse
|
||||
|
||||
void guserbase::build_pseudo(GMsg* msg, char* name, char* aka, bool direction) {
|
||||
|
||||
strcpy(direction ? msg->pseudoto : msg->pseudofrom, strlword(name));
|
||||
strcpy(direction ? msg->pseudoto : msg->pseudofrom, strlword(name, " @"));
|
||||
|
||||
if(find_entry(name, true) and not entry.is_deleted) {
|
||||
|
||||
|
Reference in New Issue
Block a user