Fixed highlightunread and areareplydirect

This commit is contained in:
Alexander S. Aganichev 2001-09-07 04:15:16 +00:00
parent 0a16f51eb0
commit 07ba5c6413
6 changed files with 258 additions and 168 deletions

View File

@ -12,6 +12,14 @@ ______________________________________________________________________
Notes for GoldED+ 1.1.5, /snapshot/
______________________________________________________________________
- Fixed AreaReplyDirect operation when AreaReply is defined (Thanks to
Pavel Gulchouck for the patch).
- Fixed problem with incorrect updating of timesread field when
MSGLISTFIRST is YES.
! @pseudo creation stops at dot now as well.
- Added EditDeleteSOL action: delete text to the start of line. It
works the same way as EditDeleteEOL in terms of what we consider to
be a line, since it deletes to the start of the line as it seen in

View File

@ -326,7 +326,7 @@ char* TokenXlat(int mode, char* input, GMsg* msg, GMsg* oldmsg, int __origarea)
continue;
if(tokenxchg(dst, "@msgs", msgs))
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", __gver_ver__))
continue;

View File

@ -43,6 +43,7 @@ int reader_direction;
int reader_rcv_noise = false;
gkey reader_keycode;
gkey reader_lastcode = 0;
bool reader_msglistfirst = false;
GMsgHeaderView *HeaderView;
GMsgBodyView *BodyView;
@ -185,9 +186,13 @@ void Reader() {
else {
AL.SetActiveAreaNo(startecho);
AA->RandomizeData();
if(AA->Msglistfirst())
if(AA->Msglistfirst()) {
reader_msglistfirst = true;
kbput(KK_ReadMessageList);
}
else
reader_msglistfirst = false;
}
if(not reader_finished) {
@ -261,6 +266,7 @@ void Reader() {
HeaderView->Paint();
if(reader_msglistfirst == false) {
if(AA->isreadmark or AA->isreadpm) {
GTag& tag = AA->isreadpm ? AA->PMrk : AA->Mark;
uint mtemp = tag.Find(msg->msgno);
@ -288,6 +294,7 @@ void Reader() {
);
}
update_statusline(buf);
}
reader_done = false;
reader_keyok = false;
@ -296,6 +303,8 @@ void Reader() {
AA->set_lastread(AA->Msgn.ToReln(msg->msgno));
AA->UpdateAreadata();
if(reader_msglistfirst == false) {
// Determine if the message is of the "twit" type
istwit = MsgIsTwit(msg, istwitto, istwitsubj);
@ -385,6 +394,9 @@ void Reader() {
default:
reader_keycode = ViewMessage(istwit);
}
}
else
reader_keycode = ReaderGetKey();
reader_topline = BodyView->UpperLine();
@ -572,6 +584,7 @@ void Reader() {
case KK_ReadMessageList:
MessageBrowse();
reader_msglistfirst = false;
break;
case KK_ReadThreadtree:
@ -580,7 +593,7 @@ void Reader() {
case KK_ReadDosShell:
DosShell();
reader_keyok = YES;
reader_keyok = true;
break;
case KK_ReadFindAll:
@ -914,6 +927,7 @@ int LoadMessage(GMsg* msg, int margin) {
msg->attr.tou1();
}
if(reader_msglistfirst == false) {
if(msg->attr.tou()) {
reader_rcv_noise = 1;
if(not msg->attr.rcv()) { // Have we seen it?
@ -952,6 +966,7 @@ int LoadMessage(GMsg* msg, int margin) {
reader_gen_confirm = true;
}
}
}
else {
msg->txt = throw_strdup("");
}

View File

@ -36,6 +36,7 @@
// Global data from GEREAD
extern GMsg* reader_msg;
extern bool reader_msglistfirst;
// ------------------------------------------------------------------
@ -485,8 +486,10 @@ void NewArea(bool jumpnext) {
OrigArea = CurrArea;
strcpy(stecho, AA->echoid());
AA->RandomizeData();
if(AA->Msglistfirst())
if(AA->Msglistfirst()) {
kbput(KK_ReadMessageList);
reader_msglistfirst = true;
}
}
}

View File

@ -273,13 +273,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;
@ -394,6 +394,8 @@ int TemplateToText(int mode, GMsg* msg, GMsg* oldmsg, const char* tpl, int origa
goto loop_next;
if(AL.AreaIdToPtr(origarea)->Areareplydirect() and oldmsg->areakludgeid and strieql(oldmsg->areakludgeid, AA->echoid()))
goto loop_next;
if(AL.AreaIdToPtr(origarea)->Areareplydirect() and strieql(AL.AreaIdToPtr(origarea)->Areareplyto(), AA->echoid()))
goto loop_next;
if(strieql(oldmsg->fwdarea, AA->echoid()))
goto loop_next;
token = end_token;
@ -962,16 +964,68 @@ void ConfirmMsg() {
bool _allow_pick = true;
void OtherAreaReplyMsg() {
if(AA->Msgn.Count()) {
int destarea = CurrArea;
if(CurrArea == OrigArea) {
if(*AA->Areareplyto()) {
int a = AL.AreaEchoToNo(AA->Areareplyto());
if(a != -1)
destarea = AL.AreaNoToId(a);
}
reader_topline = 0;
AA->attr().hex0();
const char* destinationecho = *reader_msg->fwdarea ? reader_msg->fwdarea : reader_msg->areakludgeid;
if(destinationecho and *destinationecho) {
for(uint n=0; n<AL.size(); n++) {
if(strieql(AL[n]->echoid(), destinationecho)) {
destarea = AL[n]->areaid();
break;
}
}
}
if(_allow_pick or not AA->Areareplydirect())
destarea = AreaPick(LNG->ReplyArea, 6, &destarea);
}
if(destarea != -1) {
int adat_viewhidden = AA->adat->viewhidden;
int adat_viewkludge = AA->adat->viewkludge;
int adat_viewquote = AA->adat->viewquote;
AL.SetActiveAreaId(destarea);
if(CurrArea != OrigArea) {
AA->Open();
if(CurrArea != OrigArea) {
AA->adat->viewhidden = adat_viewhidden;
AA->adat->viewkludge = adat_viewkludge;
AA->adat->viewquote = adat_viewquote;
}
}
ReplyMsg();
if(CurrArea != OrigArea) {
AA->Close();
AL.SetActiveAreaId(OrigArea);
}
}
}
}
// ------------------------------------------------------------------
void ReplyMsg() {
if(CurrArea == OrigArea) {
if(AA->Areareplydirect() and reader_msg->areakludgeid) {
int a = AL.AreaEchoToNo(reader_msg->areakludgeid);
const char *destarea = AA->Areareplyto();
if (!*destarea)
destarea = reader_msg->areakludgeid;
if(AA->Areareplydirect() and destarea) {
int a = AL.AreaEchoToNo(destarea);
if(a != -1) {
CurrArea = AL.AreaNoToId(a);
if(CurrArea != OrigArea) {
_allow_pick = false;
OtherAreaQuoteMsg();
OtherAreaReplyMsg();
_allow_pick = true;
return;
}
@ -997,8 +1051,12 @@ void ReplyMsg() {
void QuoteMsg(bool ignore_replyto) {
if(CurrArea == OrigArea) {
if(AA->Areareplydirect() and reader_msg->areakludgeid) {
int a = AL.AreaEchoToNo(reader_msg->areakludgeid);
const char *destarea = AA->Areareplyto();
if (!*destarea)
destarea = reader_msg->areakludgeid;
if(AA->Areareplydirect() and destarea) {
int a = AL.AreaEchoToNo(destarea);
if(a != -1) {
CurrArea = AL.AreaNoToId(a);
if(CurrArea != OrigArea) {
@ -1029,8 +1087,12 @@ void QuoteMsg(bool ignore_replyto) {
void CommentMsg() {
if(CurrArea == OrigArea) {
if(AA->Areareplydirect() and reader_msg->areakludgeid) {
int a = AL.AreaEchoToNo(reader_msg->areakludgeid);
const char *destarea = AA->Areareplyto();
if (!*destarea)
destarea = reader_msg->areakludgeid;
if(AA->Areareplydirect() && destarea) {
int a = AL.AreaEchoToNo(destarea);
if(a != -1) {
CurrArea = AL.AreaNoToId(a);
if(CurrArea != OrigArea) {
@ -1112,6 +1174,7 @@ void OtherAreaCommentMsg() {
if(AA->Msgn.Count()) {
int destarea = CurrArea;
if(CurrArea == OrigArea) {
if(*AA->Areareplyto()) {
int a = AL.AreaEchoToNo(AA->Areareplyto());
if(a != -1)
@ -1130,6 +1193,7 @@ void OtherAreaCommentMsg() {
}
if(_allow_pick or not AA->Areareplydirect())
destarea = AreaPick(LNG->ReplyArea, 6, &destarea);
}
if(destarea != -1) {
int adat_viewhidden = AA->adat->viewhidden;
int adat_viewkludge = AA->adat->viewkludge;

View File

@ -868,9 +868,9 @@ bool guserbase::lookup_addressbook(GMsg* msg, char* name, char* aka, bool browse
void guserbase::build_pseudo(GMsg* msg, char* name, char* aka, bool direction) {
if(*msg->iaddr and isuucp(name))
strcpy(direction ? msg->pseudoto : msg->pseudofrom, strlword(msg->iaddr, " @"));
strcpy(direction ? msg->pseudoto : msg->pseudofrom, strlword(msg->iaddr, " @."));
else
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) {