Macroses update, addressbook fixes, other changes
This commit is contained in:
@@ -826,6 +826,7 @@ CfgGed::CfgGed() {
|
||||
else
|
||||
memcpy(color, gold_color1, sizeof(color));
|
||||
*internetgate.name = 0;
|
||||
internetgateexp = (RFCName << 2) | RFCAddress;
|
||||
// internetgate.addr.reset();
|
||||
*internetserver.nntp.server = 0;
|
||||
*internetserver.smtp.server = 0;
|
||||
|
@@ -217,6 +217,7 @@ const word CRC_INTENSECOLORS = 0x5F70;
|
||||
const word CRC_INTERNETADDRESS = 0xA4D3;
|
||||
const word CRC_INTERNETDOMAIN = 0x50d7;
|
||||
const word CRC_INTERNETGATE = 0xF6C0;
|
||||
const word CRC_INTERNETGATEEXP = 0x0797;
|
||||
const word CRC_INTERNETLOOKUP = 0x0E22;
|
||||
const word CRC_INTERNETMSGID = 0xC31F;
|
||||
const word CRC_INTERNETREPLY = 0x6253;
|
||||
|
@@ -374,6 +374,7 @@ SwitchI:
|
||||
case CRC_INTERNETADDRESS : CfgInternetaddress (); break;
|
||||
case CRC_INTERNETDOMAIN : CfgInternetdomain (); break;
|
||||
case CRC_INTERNETGATE : CfgInternetgate (); break;
|
||||
case CRC_INTERNETGATEEXP : CfgInternetgateexp (); break;
|
||||
case CRC_INTERNETMSGID : CfgInternetmsgid (); break;
|
||||
case CRC_INTERNETRFCBODY : CfgInternetrfcbody (); break;
|
||||
case CRC_INTERNETSERVER : CfgInternetserver (); break;
|
||||
|
@@ -170,6 +170,23 @@ void CfgInternetgate() {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
void CfgInternetgateexp() {
|
||||
|
||||
uint exp = 0;
|
||||
char *key;
|
||||
do {
|
||||
getkeyval(&key, &val);
|
||||
if(strieql(key, "Name"))
|
||||
exp = (exp << 2) | RFCName;
|
||||
if(strieql(key, "Address"))
|
||||
exp = (exp << 2) | RFCAddress;
|
||||
}
|
||||
while(*val != NUL);
|
||||
CFG->internetgateexp = exp;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
void CfgInternetmsgid() {
|
||||
|
||||
bool flag = GetYesno(val);
|
||||
|
@@ -144,17 +144,17 @@ void CfgTearline() {
|
||||
|
||||
void CfgTemplate() {
|
||||
|
||||
char* key;
|
||||
getkeyval(&key, &val);
|
||||
if(cfgingroup) {
|
||||
Path buf;
|
||||
strxcpy(buf, val, sizeof(buf));
|
||||
strxcpy(buf, key, sizeof(buf));
|
||||
CFG->grp.AddItm(GRP_TEMPLATE, buf, strlen(buf)+1);
|
||||
}
|
||||
else {
|
||||
char* key;
|
||||
Tpl tp;
|
||||
*tp.name = NUL;
|
||||
tp.match.reset();
|
||||
getkeyval(&key, &val);
|
||||
strcpy(tp.file, key);
|
||||
if((*val == '\'') or (*val == '\"')) {
|
||||
getkeyval(&key, &val);
|
||||
|
@@ -209,6 +209,7 @@ void CfgIntensecolors ();
|
||||
void CfgInternetaddress ();
|
||||
void CfgInternetdomain ();
|
||||
void CfgInternetgate ();
|
||||
void CfgInternetgateexp ();
|
||||
void CfgInternetlookup ();
|
||||
void CfgInternetmsgid ();
|
||||
void CfgInternetreply ();
|
||||
|
@@ -73,6 +73,8 @@ const int MODE_VIEW = 116;
|
||||
const int MODE_WRITE = 117;
|
||||
const int MODE_PRINT = 118;
|
||||
const int MODE_APPEND = 119;
|
||||
const int MODE_WRITEHEADER = 120;
|
||||
const int MODE_HEADER = 121;
|
||||
|
||||
const int MODE_NEW = 0x0100;
|
||||
const int MODE_CHANGE = 0x0200;
|
||||
@@ -1006,6 +1008,11 @@ struct FileSpec {
|
||||
};
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
const int RFCAddress = 1;
|
||||
const int RFCName = 2;
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Message written by/to me/you ?
|
||||
|
||||
|
@@ -241,6 +241,7 @@ public:
|
||||
IAdr internetaddress;
|
||||
char internetdomain[96];
|
||||
Node internetgate;
|
||||
int internetgateexp;
|
||||
bool internetmsgid;
|
||||
bool internetrfcbody;
|
||||
InetServers internetserver;
|
||||
|
@@ -207,13 +207,16 @@ char* mime_header_encode(char* dest, const char* source, GMsg* msg) {
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
char* get_informative_string(char* buf) {
|
||||
const char* get_informative_string(void) {
|
||||
|
||||
sprintf(buf, "%s%s%s %s%i.%i.%i%s (%s)",
|
||||
__gver_prename__, __gver_name__, __gver_postname__,
|
||||
__gver_preversion__, __gver_major__, __gver_minor__,
|
||||
__gver_release__, __gver_postversion__, ggetosstring());
|
||||
return buf;
|
||||
static char informative_string[356] = "";
|
||||
|
||||
if(informative_string[0] == NUL)
|
||||
sprintf(informative_string, "%s%s%s %s%i.%i.%i%s (%s)",
|
||||
__gver_prename__, __gver_name__, __gver_postname__,
|
||||
__gver_preversion__, __gver_major__, __gver_minor__,
|
||||
__gver_release__, __gver_postversion__, ggetosstring());
|
||||
return informative_string;
|
||||
}
|
||||
|
||||
|
||||
@@ -335,7 +338,7 @@ void DoKludges(int mode, GMsg* msg, bool attronly) {
|
||||
}
|
||||
|
||||
// The PID: (Product ID code) kludge
|
||||
strcpy(msg->pid, __gver_shortpid__);
|
||||
strxmerge(msg->pid, sizeof(msg->pid), __gver_shortpid__, " ", __gver_ver__, NULL);
|
||||
|
||||
if(CFG->usepid and (CFG->switches.get(emptytearline) or not (striinc(__gver_longpid__, msg->tearline)))) {
|
||||
|
||||
@@ -522,7 +525,7 @@ void DoKludges(int mode, GMsg* msg, bool attronly) {
|
||||
}
|
||||
|
||||
if(AA->isnewsgroup() or AA->isemail()) {
|
||||
sprintf(buf, "%sX-%s: %s", rfc, AA->isnewsgroup() ? "Newsreader" : "Mailer", get_informative_string(buf2));
|
||||
sprintf(buf, "%sX-%s: %s", rfc, AA->isnewsgroup() ? "Newsreader" : "Mailer", get_informative_string());
|
||||
line = AddKludge(line, buf);
|
||||
line->kludge = GKLUD_RFC;
|
||||
}
|
||||
@@ -535,10 +538,13 @@ void DoKludges(int mode, GMsg* msg, bool attronly) {
|
||||
|
||||
if(AA->isnet()) {
|
||||
if(*msg->iaddr and not AA->isinternet()) {
|
||||
if(*msg->To() and (strpbrk(msg->iaddr, "<>()\"") == NULL) and not strieql(msg->To(), *AA->Internetgate().name ? AA->Internetgate().name : "UUCP")) {
|
||||
if(not (CFG->internetgateexp == RFCAddress) and *msg->To() and (strpbrk(msg->iaddr, "<>()\"") == NULL) and not strieql(msg->To(), *AA->Internetgate().name ? AA->Internetgate().name : "UUCP")) {
|
||||
Name name;
|
||||
strcpy(name, msg->To());
|
||||
sprintf(buf, "To: \"%s\" <%s>\r", StripQuotes(name), msg->iaddr);
|
||||
if(CFG->internetgateexp == ((RFCName << 2) | RFCAddress))
|
||||
sprintf(buf, "To: \"%s\" <%s>\r", StripQuotes(name), msg->iaddr);
|
||||
else
|
||||
sprintf(buf, "To: %s (%s)\r", msg->iaddr, StripQuotes(name));
|
||||
}
|
||||
else
|
||||
sprintf(buf, "To: %s\r", msg->iaddr);
|
||||
@@ -607,14 +613,6 @@ void DoTearorig(int mode, GMsg* msg) {
|
||||
line = LastLine(msg->lin);
|
||||
if(line == NULL)
|
||||
msg->lin = line = AddLine(NULL, "");
|
||||
#if 0
|
||||
else {
|
||||
ptr = line->txt.c_str();
|
||||
if(not strblank(ptr))
|
||||
if(not ((ptr[0] == ptr[1]) and (ptr[1] == ptr[2])))
|
||||
line = AddLine(line, "");
|
||||
}
|
||||
#endif
|
||||
|
||||
// Check and fix originline
|
||||
if(*msg->origin) {
|
||||
|
@@ -61,12 +61,17 @@ void SaveLines(int mode, const char* savefile, GMsg* msg, bool clip) {
|
||||
}
|
||||
int lines=0;
|
||||
if(prnfp) {
|
||||
#ifdef OLD_STYLE_HEADER
|
||||
if(mode == MODE_WRITE) {
|
||||
if(prnheader)
|
||||
DispHeader(msg, prn, prnfp, prnmargin);
|
||||
if(prn)
|
||||
lines = 6;
|
||||
}
|
||||
#else
|
||||
TemplateToText(((mode == MODE_WRITE) && prnheader) ? MODE_WRITEHEADER : ((prnheader & WRITE_ONLY_HEADER) ? MODE_HEADER : MODE_WRITE), msg, msg, AA->Tpl(), CurrArea);
|
||||
msg->TextToLines(-prnmargin);
|
||||
#endif
|
||||
int n = 0;
|
||||
Line** lin = msg->line;
|
||||
if(lin and not (prnheader & WRITE_ONLY_HEADER)) {
|
||||
|
@@ -50,8 +50,6 @@ char m_title[80]; // Menu title string
|
||||
int m_titlepos; // Menu title position
|
||||
int m_titleattr; // Menu title color
|
||||
|
||||
char* tconv;
|
||||
|
||||
int AreaKeys = 0;
|
||||
int ReadKeys = 0;
|
||||
int ListKeys = 0;
|
||||
|
@@ -100,8 +100,6 @@ extern char m_title[];
|
||||
extern int m_titlepos;
|
||||
extern int m_titleattr;
|
||||
|
||||
extern char* tconv;
|
||||
|
||||
extern int AreaKeys, ReadKeys, ListKeys, NodeKeys, EditKeys, FileKeys;
|
||||
extern list<CmdKey>::iterator AreaKey, ReadKey, ListKey, NodeKey, EditKey, FileKey;
|
||||
|
||||
@@ -187,6 +185,8 @@ extern const char* __gver_date__;
|
||||
extern const char* __gver_time__;
|
||||
extern const char* __gver_longpid__;
|
||||
extern const char* __gver_shortpid__;
|
||||
extern const char* __gver_ver__;
|
||||
extern const char* __gver_shortver__;
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
@@ -305,6 +305,10 @@ bool GMsgHeaderEdit::validate() {
|
||||
fromaddr.buf = ffromaddr->buf; fromaddr.update = false;
|
||||
subj.buf = fsubj->buf; subj.update = false;
|
||||
|
||||
INam iaddr, realto;
|
||||
strcpy(iaddr, msg->iaddr);
|
||||
strcpy(realto, msg->realto);
|
||||
|
||||
bool res = set_to_address(msg, &toname, &toaddr, &fromaddr, &subj, 0, LNG->SelectDestNode, lookup);
|
||||
|
||||
vcurshow();
|
||||
@@ -313,9 +317,13 @@ bool GMsgHeaderEdit::validate() {
|
||||
strsetsz(bot2, EDIT->HdrNodeLen());
|
||||
window.prints(1, EDIT->HdrNodePos(), C_HEADW, bot2);
|
||||
|
||||
// once we changed name invalidate realto
|
||||
if(not strieql(orig_toname.c_str(), toname.buf))
|
||||
*msg->realto = NUL;
|
||||
// once we changed name invalidate realto and internet address
|
||||
if(not strieql(orig_toname.c_str(), toname.buf)) {
|
||||
if(strieql(realto, msg->realto))
|
||||
*msg->realto = NUL;
|
||||
if(not AA->isinternet() and strieql(iaddr, msg->iaddr))
|
||||
*msg->iaddr = NUL;
|
||||
}
|
||||
|
||||
if(toname.update) current->update();
|
||||
if(toaddr.update) ftoaddr->update();
|
||||
@@ -442,8 +450,14 @@ int EditHeaderinfo(int mode, GMsgHeaderView &view) {
|
||||
strcpy(msg->realto, msg->to);
|
||||
strcpy(msg->iorig, from_addr.c_str());
|
||||
strcpy(msg->idest, to_addr.c_str());
|
||||
strcpy(msg->ifrom, msg->iorig);
|
||||
strcpy(msg->ito, msg->idest);
|
||||
if(*msg->by)
|
||||
sprintf(msg->ifrom, "%s (%s)", msg->iorig, msg->by);
|
||||
else
|
||||
sprintf(msg->ifrom, "%s", msg->iorig);
|
||||
if(*msg->to)
|
||||
sprintf(msg->ito, "%s (%s)", msg->idest, msg->to);
|
||||
else
|
||||
sprintf(msg->ito, "%s", msg->idest);
|
||||
if(msg->orig.net == 0)
|
||||
msg->orig = msg->oorig = AA->Aka().addr;
|
||||
if(msg->dest.net == 0)
|
||||
@@ -451,8 +465,9 @@ int EditHeaderinfo(int mode, GMsgHeaderView &view) {
|
||||
}
|
||||
else {
|
||||
if(strchr(to_name.c_str(), '@')) {
|
||||
if(*AA->Internetgate().name)
|
||||
if(*AA->Internetgate().name) {
|
||||
strcpy(msg->iaddr, to_name.c_str());
|
||||
}
|
||||
else {
|
||||
if(to_name.length() > 34) {
|
||||
strcpy(msg->to, "UUCP");
|
||||
@@ -465,6 +480,16 @@ int EditHeaderinfo(int mode, GMsgHeaderView &view) {
|
||||
else
|
||||
strcpy(msg->to, to_name.c_str());
|
||||
|
||||
if(*msg->iaddr) {
|
||||
if(*msg->To() and (strpbrk(msg->iaddr, "<>()\"") == NULL) and not strieql(msg->To(), *AA->Internetgate().name ? AA->Internetgate().name : "UUCP")) {
|
||||
Name name;
|
||||
strcpy(name, msg->To());
|
||||
sprintf(msg->ito, "%s (%s)", msg->iaddr, StripQuotes(name));
|
||||
}
|
||||
else
|
||||
strcpy(msg->ito, msg->iaddr);
|
||||
}
|
||||
|
||||
Addr address;
|
||||
address = AA->Aka().addr;
|
||||
|
||||
|
@@ -24,18 +24,18 @@
|
||||
// Header display.
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
#ifdef OLD_STYLE_HEADER
|
||||
|
||||
#include <golded.h>
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
char* strconv(char* str, char* conv) {
|
||||
static char* strconv(char* str) {
|
||||
|
||||
char* s=str;
|
||||
char* p = str;
|
||||
|
||||
NW(conv); // Dummy
|
||||
|
||||
while(*str) {
|
||||
if(iscntrl(*str) and (*str != '\n') and (*str != '\r')) // Control codes
|
||||
*p++ = '.';
|
||||
@@ -79,39 +79,44 @@ void DispHeader(GMsg* msg, bool prn, FILE* fp, int width) {
|
||||
|
||||
// Generate top line fields
|
||||
char buf[256];
|
||||
char top1[200];
|
||||
char buf1[200];
|
||||
char buf2[200];
|
||||
strtrim(strcpy(buf, AA->desc()));
|
||||
if((CFG->dispareano == ALWAYS) or (CFG->dispareano and AA->board()))
|
||||
sprintf(top1, " [%u] %s ", AA->board(), buf);
|
||||
sprintf(buf1, " [%u] %s ", AA->board(), buf);
|
||||
else
|
||||
sprintf(top1, " %s ", buf);
|
||||
strtrim(top1);
|
||||
strcat(top1, " (" /*)*/);
|
||||
sprintf(buf1, " %s ", buf);
|
||||
strtrim(buf1);
|
||||
strcat(buf1, " (" /*)*/);
|
||||
if(AA->isinternet())
|
||||
strcpy(buf, AA->Internetaddress());
|
||||
else
|
||||
AA->Aka().addr.make_string(buf);
|
||||
strcat(top1, buf);
|
||||
strcat(top1, /*(*/ ") ");
|
||||
strcat(buf1, buf);
|
||||
strcat(buf1, /*(*/ ") ");
|
||||
|
||||
char top2[200];
|
||||
if(msg->areakludgeid)
|
||||
sprintf(top2, " %s (%s) ", AA->echoid(), msg->areakludgeid);
|
||||
sprintf(buf2, " %s (%s) ", AA->echoid(), msg->areakludgeid);
|
||||
else
|
||||
sprintf(top2, " %s ", AA->echoid());
|
||||
sprintf(buf2, " %s ", AA->echoid());
|
||||
|
||||
// Write the total header to a file
|
||||
strcpy(stpcpy(buf, headerline), prn ? NL : "\n");
|
||||
strncpy(buf+1, buf1, strlen(buf1));
|
||||
strncpy(buf+width-strlen(buf2)-1, buf2, strlen(buf2));
|
||||
strconv(buf);
|
||||
fwrite(buf, strlen(buf), 1, fp);
|
||||
|
||||
// Generate message attributes string
|
||||
char bot2[200];
|
||||
MakeAttrStr(bot2, &msg->attr);
|
||||
int len2 = strlen(bot2);
|
||||
MakeAttrStr(buf2, &msg->attr);
|
||||
int len2 = strlen(buf2);
|
||||
if(len2 > width-CFG->disphdrnodeset.pos) {
|
||||
len2 = width-CFG->disphdrnodeset.pos;
|
||||
strsetsz(bot2, len2);
|
||||
strsetsz(buf2, len2);
|
||||
}
|
||||
|
||||
// Generate message number and reply links string
|
||||
char bot1[200];
|
||||
char* ptr = bot1;
|
||||
char* ptr = buf1;
|
||||
int list_max = msg->link.list_max();
|
||||
ulong* replies = (ulong*)throw_calloc(list_max+1, sizeof(ulong));
|
||||
ulong replyto, replynext;
|
||||
@@ -139,106 +144,100 @@ void DispHeader(GMsg* msg, bool prn, FILE* fp, int width) {
|
||||
ptr += sprintf(ptr, " %s%lu", (plus++?"":"+"), replies[replyn]);
|
||||
if(replynext)
|
||||
sprintf(ptr, " *%lu", replynext);
|
||||
int len1 = strlen(bot1)-8;
|
||||
int len1 = strlen(buf1)-8;
|
||||
if((CFG->disphdrnameset.pos + len1) > CFG->disphdrnodeset.pos) {
|
||||
if(8 + len1 + len2 > width) {
|
||||
strsetsz(bot1, width-len2-1);
|
||||
strtrim(bot1);
|
||||
strsetsz(buf1, width-len2-1);
|
||||
strtrim(buf1);
|
||||
}
|
||||
strcat(bot1, " ");
|
||||
strcat(bot1, bot2);
|
||||
*bot2 = NUL;
|
||||
strcat(buf1, " ");
|
||||
strcat(buf1, buf2);
|
||||
*buf2 = NUL;
|
||||
}
|
||||
else {
|
||||
strsetsz(bot1, namewidth+8);
|
||||
strcat(bot1, bot2);
|
||||
*bot2 = NUL;
|
||||
strsetsz(buf1, namewidth+8);
|
||||
strcat(buf1, buf2);
|
||||
*buf2 = NUL;
|
||||
}
|
||||
strsetsz(bot1, width);
|
||||
strsetsz(buf1, width);
|
||||
throw_free(replies);
|
||||
|
||||
// Generate orig node data
|
||||
char node1[200];
|
||||
if(msg->orig.net)
|
||||
msg->orig.make_string(node1);
|
||||
else
|
||||
*node1 = NUL;
|
||||
strsetsz(node1, nodewidth);
|
||||
// Write message info
|
||||
strcpy(stpcpy(buf, buf1), buf2);
|
||||
strtrim(buf);
|
||||
strcat(buf, prn ? NL : "\n");
|
||||
strconv(buf);
|
||||
fwrite(buf, strlen(buf), 1, fp);
|
||||
|
||||
// Generate orig node data
|
||||
if(msg->orig.net)
|
||||
msg->orig.make_string(buf1);
|
||||
else
|
||||
*buf1 = NUL;
|
||||
strsetsz(buf1, nodewidth);
|
||||
|
||||
char date1[25] = "";
|
||||
if(msg->written)
|
||||
strftimei(date1, CFG->disphdrdateset.len, LNG->DateTimeFmt, gmtime(&msg->written));
|
||||
strsetsz(date1, datewidth);
|
||||
strftimei(buf2, CFG->disphdrdateset.len, LNG->DateTimeFmt, gmtime(&msg->written));
|
||||
strsetsz(buf2, datewidth);
|
||||
|
||||
// write from line
|
||||
sprintf(buf, "%s%s%s%s",
|
||||
LNG->From, whofrom,
|
||||
((not (*msg->ifrom and (*msg->realby or *msg->iorig))) and not AA->isinternet()) ? buf1 : "",
|
||||
buf2
|
||||
);
|
||||
strtrim(buf);
|
||||
strcat(buf, prn ? NL : "\n");
|
||||
strconv(buf);
|
||||
fwrite(buf, strlen(buf), 1, fp);
|
||||
|
||||
// Generate dest node data
|
||||
char node2[200];
|
||||
if(msg->dest.net and AA->isnet()) {
|
||||
msg->dest.make_string(node2);
|
||||
msg->dest.make_string(buf2);
|
||||
if(msg->odest.net) {
|
||||
if(msg->odest.net != msg->dest.net or msg->odest.node != msg->dest.node) {
|
||||
sprintf(buf, " %s %u/%u", LNG->Via, msg->odest.net, msg->odest.node);
|
||||
strcat(node2, buf);
|
||||
strcat(buf2, buf);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
*node2 = NUL;
|
||||
strsetsz(node2, nodewidth);
|
||||
*buf2 = NUL;
|
||||
strsetsz(buf2, nodewidth);
|
||||
|
||||
char date2[25] = "";
|
||||
if(msg->arrived)
|
||||
strftimei(date2, CFG->disphdrdateset.len, LNG->DateTimeFmt, gmtime(&msg->arrived));
|
||||
strsetsz(date2, datewidth);
|
||||
strftimei(buf2, CFG->disphdrdateset.len, LNG->DateTimeFmt, gmtime(&msg->arrived));
|
||||
strsetsz(buf2, datewidth);
|
||||
|
||||
// write to line
|
||||
sprintf(buf, "%s%s%s%s", LNG->To, whoto,
|
||||
((not (*msg->ito and (*msg->realto or *msg->idest))) and not AA->isinternet()) ? buf2 : "",
|
||||
buf2
|
||||
);
|
||||
strtrim(buf);
|
||||
strcat(buf, prn ? NL : "\n");
|
||||
strconv(buf);
|
||||
fwrite(buf, strlen(buf), 1, fp);
|
||||
|
||||
// Generate subjectline
|
||||
char subj[200], lngsubj[10];
|
||||
strcpy(lngsubj, (msg->attr.att() or msg->attr.frq() or msg->attr.urq()) ? LNG->File : LNG->Subj);
|
||||
strxcpy(subj, msg->re, sizeof(subj));
|
||||
strsetsz(subj, width-strlen(lngsubj));
|
||||
strcpy(buf2, (msg->attr.att() or msg->attr.frq() or msg->attr.urq()) ? LNG->File : LNG->Subj);
|
||||
strxcpy(buf1, msg->re, sizeof(buf1));
|
||||
strsetsz(buf1, width-strlen(buf2));
|
||||
|
||||
// Write the total header to a file
|
||||
// write subject line
|
||||
strcpy(stpcpy(buf, buf2), buf1);
|
||||
strtrim(buf);
|
||||
strcat(buf, prn ? NL : "\n");
|
||||
strconv(buf);
|
||||
fwrite(buf, strlen(buf), 1, fp);
|
||||
|
||||
// write bottom line
|
||||
strcpy(stpcpy(buf, headerline), prn ? NL : "\n");
|
||||
strncpy(buf+1, top1, strlen(top1));
|
||||
strncpy(buf+width-strlen(top2)-1, top2, strlen(top2));
|
||||
strconv(buf, tconv);
|
||||
fwrite(buf, strlen(buf), 1, fp);
|
||||
|
||||
strcpy(stpcpy(buf, bot1), bot2);
|
||||
strtrim(buf);
|
||||
strcat(buf, prn ? NL : "\n");
|
||||
strconv(buf, tconv);
|
||||
fwrite(buf, strlen(buf), 1, fp);
|
||||
|
||||
sprintf(buf, "%s%s%s%s",
|
||||
LNG->From, whofrom,
|
||||
((not (*msg->ifrom and (*msg->realby or *msg->iorig))) and not AA->isinternet()) ? node1 : "",
|
||||
date1
|
||||
);
|
||||
strtrim(buf);
|
||||
strcat(buf, prn ? NL : "\n");
|
||||
strconv(buf, tconv);
|
||||
fwrite(buf, strlen(buf), 1, fp);
|
||||
|
||||
sprintf(buf, "%s%s%s%s", LNG->To, whoto,
|
||||
((not (*msg->ito and (*msg->realto or *msg->idest))) and not AA->isinternet()) ? node2 : "",
|
||||
date2
|
||||
);
|
||||
strtrim(buf);
|
||||
strcat(buf, prn ? NL : "\n");
|
||||
strconv(buf, tconv);
|
||||
fwrite(buf, strlen(buf), 1, fp);
|
||||
|
||||
strcpy(stpcpy(buf, lngsubj), subj);
|
||||
strtrim(buf);
|
||||
strcat(buf, prn ? NL : "\n");
|
||||
strconv(buf, tconv);
|
||||
fwrite(buf, strlen(buf), 1, fp);
|
||||
|
||||
strcpy(stpcpy(buf, headerline), prn ? NL : "\n");
|
||||
strconv(buf, tconv);
|
||||
strconv(buf);
|
||||
fwrite(buf, strlen(buf), 1, fp);
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
#endif
|
||||
|
@@ -506,7 +506,7 @@ void Initialize(int argc, char* argv[]) {
|
||||
srand((unsigned)time(NULL));
|
||||
|
||||
// Display startup banner
|
||||
cout << __gver_longpid__ << endl;
|
||||
cout << __gver_longpid__ << " " << __gver_ver__ << endl;
|
||||
|
||||
// Check environment commandline
|
||||
ptr = getenv("GEDCMD");
|
||||
@@ -685,7 +685,7 @@ void Initialize(int argc, char* argv[]) {
|
||||
|
||||
// Start the log
|
||||
static char buf[200];
|
||||
sprintf(buf, "%s (%s %s)", __gver_longpid__, __gver_date__, __gver_time__);
|
||||
sprintf(buf, "%s %s (%s %s)", __gver_longpid__, __gver_ver__, __gver_date__, __gver_time__);
|
||||
LOG.open(CFG->logfile, buf, __gver_shortlogname__, CFG->logformat);
|
||||
|
||||
// Read/compile various configs
|
||||
|
@@ -1592,8 +1592,6 @@ void ScanKludges(GMsg* msg, int getvalue) {
|
||||
KludgeFROM(msg, tmp ? tmp : ptr);
|
||||
if(tmp)
|
||||
throw_free(tmp);
|
||||
if(not AA->isinternet())
|
||||
*msg->ifrom = NUL;
|
||||
}
|
||||
else if(strnieql(line->txt.c_str(), "To:", 3)) {
|
||||
const char* ptr = line->txt.c_str() + 3;
|
||||
@@ -1602,8 +1600,6 @@ void ScanKludges(GMsg* msg, int getvalue) {
|
||||
KludgeTO(msg, tmp ? tmp : ptr);
|
||||
if(tmp)
|
||||
throw_free(tmp);
|
||||
if(not AA->isinternet())
|
||||
*msg->ito = NUL;
|
||||
}
|
||||
else if(strnieql(line->txt.c_str(), "Reply-To:", 9)) {
|
||||
const char* ptr = line->txt.c_str() + 9;
|
||||
@@ -2549,6 +2545,8 @@ void MakeLineIndex(GMsg* msg, int margin, bool header_recode) {
|
||||
strxmimecpy(msg->realto, msg->realto, 0, sizeof(INam), true);
|
||||
strxmimecpy(msg->by, msg->by, level, sizeof(INam), true);
|
||||
strxmimecpy(msg->to, msg->to, level, sizeof(INam), true);
|
||||
strxmimecpy(msg->ifrom, msg->ifrom, 0, sizeof(INam), true);
|
||||
strxmimecpy(msg->ito, msg->ito, 0, sizeof(msg->ito), true);
|
||||
|
||||
if(not (msg->attr.frq() or msg->attr.att() or msg->attr.urq()))
|
||||
strxmimecpy(msg->re, msg->re, level, sizeof(ISub), true);
|
||||
|
@@ -59,9 +59,9 @@ static bool tokenxchg(char*& dst, char* tok, const char* src, int len = 0, int c
|
||||
if(dst[toklen] == '{') {
|
||||
char *p = strchr(dst+toklen, '}');
|
||||
if(p) {
|
||||
uint len = p-dst-toklen-1;
|
||||
if(use && len) {
|
||||
strxcpy (buf, dst+toklen+1, len+1);
|
||||
uint dstlen = p-dst-toklen-1;
|
||||
if(use && dstlen) {
|
||||
strxcpy (buf, dst+toklen+1, dstlen+1);
|
||||
src = buf;
|
||||
}
|
||||
toklen = p-dst+1;
|
||||
@@ -74,33 +74,31 @@ static bool tokenxchg(char*& dst, char* tok, const char* src, int len = 0, int c
|
||||
uint srclen = (len == 0) ? sl : len;
|
||||
memmove(dst+srclen, dst+toklen, strlen(dst+toklen)+1);
|
||||
memset(dst, ' ', srclen);
|
||||
memcpy(dst, src, sl);
|
||||
memcpy(dst, src, ((len != 0) and (len < sl)) ? len : sl);
|
||||
dst += srclen;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
static bool domain_requested(const char *str) {
|
||||
|
||||
return strnieql(str, "{domain}", 8);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
char* TokenXlat(int mode, char* input, GMsg* msg, GMsg* oldmsg, int __origarea) {
|
||||
|
||||
char longpid[100];
|
||||
sprintf(longpid, "%s%s%s%s", __gver_prename__, __gver_name__, __gver_postname__, __gver_platform__);
|
||||
static char revbuf[5] = "";
|
||||
if(revbuf[0] == NUL)
|
||||
sprintf(revbuf, "%02d%02d", str2mon(__gver_date__), atoi(&__gver_date__[4]));
|
||||
|
||||
char shortpid[100];
|
||||
sprintf(shortpid, "%s%s", __gver_shortname__, __gver_shortplatform__);
|
||||
char attr[80];
|
||||
MakeAttrStr(attr, &msg->attr);
|
||||
|
||||
char longverbuf[100];
|
||||
sprintf(longverbuf, "%s%i.%i.%i%s", __gver_preversion__, __gver_major__, __gver_minor__, __gver_release__, __gver_postversion__);
|
||||
|
||||
char verbuf[100];
|
||||
sprintf(verbuf, "%i.%i.%i", __gver_major__, __gver_minor__, __gver_release__);
|
||||
|
||||
char revbuf[100];
|
||||
sprintf(revbuf, "%02d%02d", str2mon(__gver_date__), atoi(&__gver_date__[4]));
|
||||
|
||||
char xmailer[356];
|
||||
get_informative_string(xmailer);
|
||||
const char *xmailer = get_informative_string();
|
||||
|
||||
time_t t = time(NULL);
|
||||
struct tm* written_tm = localtime(&t);
|
||||
@@ -114,13 +112,17 @@ char* TokenXlat(int mode, char* input, GMsg* msg, GMsg* oldmsg, int __origarea)
|
||||
char otime[80];
|
||||
strftimei(otime, 80, LNG->TimeFmt, written_tm);
|
||||
|
||||
const char* osslashbuf = __gver_platform__;
|
||||
|
||||
const char* origareaid = AL.AreaIdToPtr(__origarea)->echoid();
|
||||
bool origareaisinet = AL.AreaIdToPtr(__origarea)->isinternet();
|
||||
bool currareaisinet = AA->isinternet();
|
||||
char* modereptr = oldmsg->re;
|
||||
|
||||
char msgno[16];
|
||||
sprintf(msgno, "%u", msg->attr.nwm() ? AA->Msgn.Count() + 1 : AA->Msgn.ToReln(msg->msgno));
|
||||
|
||||
char msgs[16];
|
||||
sprintf(msgs, "%u", AA->Msgn.Count() + (msg->attr.nwm() ? 1 : 0));
|
||||
|
||||
if((mode == MODE_QUOTE) or (mode == MODE_REPLYCOMMENT) or (mode == MODE_REPLY)) {
|
||||
if(AL.AreaIdToPtr(__origarea)->Areareplydirect() and oldmsg->areakludgeid)
|
||||
origareaid = oldmsg->areakludgeid;
|
||||
@@ -151,16 +153,16 @@ char* TokenXlat(int mode, char* input, GMsg* msg, GMsg* oldmsg, int __origarea)
|
||||
if(tokenxchg(dst, "@odesc", AL.AreaEchoToPtr(origareaid)->desc()))
|
||||
continue;
|
||||
if(origareaisinet) {
|
||||
if(tokenxchg(dst, "@oaddr", oldmsg->iorig, 19))
|
||||
if(tokenxchg(dst, "@oaddr", oldmsg->iorig, 19, 1, 0))
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
if(tokenxchg(dst, "@oaddr", oldmsg->orig.make_string(buf, oldmsg->odom), 19))
|
||||
if(tokenxchg(dst, "@oaddr", oldmsg->orig.make_string(buf, domain_requested(dst+6) ? oldmsg->odom : NULL), 19, 1, 0))
|
||||
continue;
|
||||
if(strnieql(dst, "@o3daddr", 8)) {
|
||||
ftn_addr boss = oldmsg->orig;
|
||||
boss.point = 0;
|
||||
tokenxchg(dst, "@o3daddr", boss.make_string(buf, oldmsg->odom), 19);
|
||||
tokenxchg(dst, "@o3daddr", boss.make_string(buf, domain_requested(dst+8) ? oldmsg->odom : NULL), 19, 1, 0);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -179,25 +181,25 @@ char* TokenXlat(int mode, char* input, GMsg* msg, GMsg* oldmsg, int __origarea)
|
||||
continue;
|
||||
if(tokenxchg(dst, "@otzoffset", (oldmsg->tzutc == -32767) ? "" : (sprintf(buf, " %+05d", oldmsg->tzutc), buf)))
|
||||
continue;
|
||||
if(tokenxchg(dst, "@ofrom", oldmsg->ifrom))
|
||||
if(tokenxchg(dst, "@ofrom", *oldmsg->ifrom ? oldmsg->ifrom : oldmsg->By()))
|
||||
continue;
|
||||
if(tokenxchg(dst, "@oto", oldmsg->ito))
|
||||
if(tokenxchg(dst, "@oto", *oldmsg->ito ? oldmsg->ito : oldmsg->To()))
|
||||
continue;
|
||||
if(tokenxchg(dst, "@omessageid", oldmsg->messageid ? oldmsg->messageid : ""))
|
||||
continue;
|
||||
if(tokenxchg(dst, "@omsgid", *msg->replys ? msg->replys : ""))
|
||||
continue;
|
||||
if(origareaisinet) {
|
||||
if(tokenxchg(dst, "@daddr", oldmsg->iaddr, 19))
|
||||
if(tokenxchg(dst, "@daddr", oldmsg->iaddr, 19, 1, 0))
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
if(tokenxchg(dst, "@daddr", oldmsg->dest.make_string(buf, oldmsg->ddom), 19))
|
||||
if(tokenxchg(dst, "@daddr", oldmsg->dest.make_string(buf, domain_requested(dst+6) ? oldmsg->ddom : NULL), 19, 1, 0))
|
||||
continue;
|
||||
if(strnieql(dst, "@d3daddr", 8)) {
|
||||
ftn_addr boss = oldmsg->dest;
|
||||
boss.point = 0;
|
||||
tokenxchg(dst, "@d3daddr", boss.make_string(buf, oldmsg->ddom), 19);
|
||||
tokenxchg(dst, "@d3daddr", boss.make_string(buf, domain_requested(dst+8) ? oldmsg->ddom : NULL), 19, 1, 0);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -211,16 +213,16 @@ char* TokenXlat(int mode, char* input, GMsg* msg, GMsg* oldmsg, int __origarea)
|
||||
msg->to_me(), msg->to_you(), oldmsg->to_all()))
|
||||
continue;
|
||||
if(currareaisinet) {
|
||||
if(tokenxchg(dst, "@taddr", msg->iaddr, 19))
|
||||
if(tokenxchg(dst, "@taddr", msg->iaddr, 19, 1, 0))
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
if(tokenxchg(dst, "@taddr", msg->dest.make_string(buf, msg->ddom), 19))
|
||||
if(tokenxchg(dst, "@taddr", msg->dest.make_string(buf, domain_requested(dst+6) ? msg->ddom : NULL), 19, 1, 0))
|
||||
continue;
|
||||
if(strnieql(dst, "@t3daddr", 8)) {
|
||||
ftn_addr boss = msg->dest;
|
||||
boss.point = 0;
|
||||
tokenxchg(dst, "@t3daddr", boss.make_string(buf, msg->ddom), 19);
|
||||
tokenxchg(dst, "@t3daddr", boss.make_string(buf, domain_requested(dst+8) ? msg->ddom : NULL), 19, 1, 0);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -234,16 +236,17 @@ char* TokenXlat(int mode, char* input, GMsg* msg, GMsg* oldmsg, int __origarea)
|
||||
false, false, msg->to_all()))
|
||||
continue;
|
||||
if(currareaisinet) {
|
||||
if(tokenxchg(dst, "@caddr", AA->Internetaddress(), 19))
|
||||
if(tokenxchg(dst, "@caddr", AA->Internetaddress(), 19, 1, 0))
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
if(tokenxchg(dst, "@caddr", AA->Aka().addr.make_string(buf), 19))
|
||||
const gaka &caka=AA->Aka();
|
||||
if(tokenxchg(dst, "@caddr", caka.addr.make_string(buf, domain_requested(dst+6) ? caka.domain : NULL), 19, 1, 0))
|
||||
continue;
|
||||
if(strnieql(dst, "@c3daddr", 8)) {
|
||||
ftn_addr boss = AA->Aka().addr;
|
||||
ftn_addr boss = caka.addr;
|
||||
boss.point = 0;
|
||||
tokenxchg(dst, "@c3daddr", boss.make_string(buf), 19);
|
||||
tokenxchg(dst, "@c3daddr", boss.make_string(buf, domain_requested(dst+8) ? caka.domain : NULL), 19, 1, 0);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -253,6 +256,10 @@ char* TokenXlat(int mode, char* input, GMsg* msg, GMsg* oldmsg, int __origarea)
|
||||
continue;
|
||||
if(tokenxchg(dst, "@clname", strrword(strcpy(buf, AA->Username().name))))
|
||||
continue;
|
||||
if(tokenxchg(dst, "@cfrom", *msg->ifrom ? msg->ifrom : msg->By()))
|
||||
continue;
|
||||
if(tokenxchg(dst, "@cto", *msg->ito ? msg->ito : msg->To()))
|
||||
continue;
|
||||
if(tokenxchg(dst, "@cdate", cdate))
|
||||
continue;
|
||||
if(tokenxchg(dst, "@ctime", ctime))
|
||||
@@ -260,16 +267,16 @@ char* TokenXlat(int mode, char* input, GMsg* msg, GMsg* oldmsg, int __origarea)
|
||||
if(tokenxchg(dst, "@ctzoffset", AA->Usetzutc() ? (sprintf(buf, " %+05d", tzoffset()), buf) : ""))
|
||||
continue;
|
||||
if(currareaisinet) {
|
||||
if(tokenxchg(dst, "@faddr", msg->iorig, 19))
|
||||
if(tokenxchg(dst, "@faddr", msg->iorig, 19, 1, 0))
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
if(tokenxchg(dst, "@faddr", msg->orig.make_string(buf, msg->odom), 19))
|
||||
if(tokenxchg(dst, "@faddr", msg->orig.make_string(buf, domain_requested(dst+6) ? msg->odom : NULL), 19, 1, 0))
|
||||
continue;
|
||||
if(strnieql(dst, "@f3daddr", 8)) {
|
||||
ftn_addr boss = msg->orig;
|
||||
boss.point = 0;
|
||||
tokenxchg(dst, "@f3daddr", boss.make_string(buf, msg->odom), 19);
|
||||
tokenxchg(dst, "@f3daddr", boss.make_string(buf, domain_requested(dst+8) ? msg->odom : NULL), 19, 1, 0);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -310,28 +317,47 @@ char* TokenXlat(int mode, char* input, GMsg* msg, GMsg* oldmsg, int __origarea)
|
||||
tokenxchg(dst, "@fpseudo", msg->pseudofrom);
|
||||
continue;
|
||||
}
|
||||
if(tokenxchg(dst, "@msgno", msgno))
|
||||
continue;
|
||||
if(tokenxchg(dst, "@msgs", msgs))
|
||||
continue;
|
||||
if(tokenxchg(dst, "@cpseudo", *AA->Nickname() ? AA->Nickname() : strlword(strcpy(buf, AA->Username().name), " @")))
|
||||
continue;
|
||||
if(tokenxchg(dst, "@version", longverbuf))
|
||||
if(tokenxchg(dst, "@version", __gver_ver__))
|
||||
continue;
|
||||
if(tokenxchg(dst, "@ver", verbuf))
|
||||
if(tokenxchg(dst, "@ver", __gver_shortver__))
|
||||
continue;
|
||||
if(tokenxchg(dst, "@rev", revbuf))
|
||||
continue;
|
||||
if(tokenxchg(dst, "@pid", shortpid))
|
||||
if(strnieql(dst, "@align{", 6)) {
|
||||
char *ptr = strchr(dst, '}');
|
||||
if(ptr) {
|
||||
int size = atoi(dst+7) - (dst-input);
|
||||
if(size > 0) {
|
||||
char filler = ' ';
|
||||
if((ptr[1] == '{') and (ptr[3] == '}')) {
|
||||
filler = ptr[2];
|
||||
ptr += 3;
|
||||
}
|
||||
memmove(dst+size, ptr+1, strlen(ptr+1)+1);
|
||||
memset(dst, filler, size);
|
||||
dst += size;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
if(tokenxchg(dst, "@longpid", longpid))
|
||||
}
|
||||
if(tokenxchg(dst, "@pid", __gver_shortpid__))
|
||||
continue;
|
||||
if(tokenxchg(dst, "@longpid", __gver_longpid__))
|
||||
continue;
|
||||
if(tokenxchg(dst, "@widepid", xmailer))
|
||||
continue;
|
||||
if(tokenxchg(dst, "@serialno", ""))
|
||||
continue;
|
||||
if(tokenxchg(dst, "@os2slash", osslashbuf))
|
||||
continue;
|
||||
if(tokenxchg(dst, "@osslash", osslashbuf))
|
||||
if(tokenxchg(dst, "@osslash", __gver_platform__))
|
||||
continue;
|
||||
if(tokenxchg(dst, "@subject", modereptr))
|
||||
continue;
|
||||
if(tokenxchg(dst, "@attr", attr))
|
||||
continue;
|
||||
if(tokenxchg(dst, "@tagline",
|
||||
HandleRandomLine(strxcpy(buf, AA->Tagline(), sizeof(buf)), sizeof(buf))))
|
||||
continue;
|
||||
|
@@ -689,7 +689,7 @@ void MakeMsg(int mode, GMsg* omsg, bool ignore_replyto) {
|
||||
|
||||
GFTRK("MakeMsg");
|
||||
|
||||
// Tell DispHeader not to show msg size
|
||||
// Tell GMsgHeaderView not to show msg size
|
||||
_in_editor = YES;
|
||||
|
||||
// Allocate some msgs
|
||||
@@ -762,7 +762,7 @@ void MakeMsg(int mode, GMsg* omsg, bool ignore_replyto) {
|
||||
msg->inreplyto = NULL;
|
||||
msg->references = NULL;
|
||||
msg->attr.tou0();
|
||||
msg->TextToLines(CFG->dispmargin-1, false);
|
||||
msg->TextToLines(CFG->dispmargin-1);
|
||||
*msg->iorig = NUL;
|
||||
*msg->idest = NUL;
|
||||
*msg->ireplyto = NUL;
|
||||
@@ -788,7 +788,7 @@ void MakeMsg(int mode, GMsg* omsg, bool ignore_replyto) {
|
||||
msg->inreplyto = NULL;
|
||||
msg->references = NULL;
|
||||
msg->attr.tou0();
|
||||
msg->TextToLines(CFG->dispmargin-1, false);
|
||||
msg->TextToLines(CFG->dispmargin-1);
|
||||
break;
|
||||
case MODE_NEW:
|
||||
wfill(MINROW, 0, MAXROW-2, MAXCOL-1, ' ', C_READW);
|
||||
@@ -830,7 +830,7 @@ void MakeMsg(int mode, GMsg* omsg, bool ignore_replyto) {
|
||||
case MODE_QUOTE:
|
||||
case MODE_REPLYCOMMENT:
|
||||
omsg->attr.tou0();
|
||||
omsg->TextToLines(-CFG->quotemargin, false);
|
||||
omsg->TextToLines(-CFG->quotemargin);
|
||||
if(ignore_replyto)
|
||||
omsg->ireplyto[0] = NUL;
|
||||
if(omsg->attr.rot())
|
||||
|
@@ -100,7 +100,7 @@ void DoTearorig(int mode, GMsg* msg);
|
||||
void GetRandom(int mode, GMsg* msg);
|
||||
char* GetRandomLine(char* __buf, size_t __bufsize, const char* __file);
|
||||
char* HandleRandomLine(char* buf, size_t bufsize);
|
||||
char* get_informative_string(char* buf);
|
||||
const char* get_informative_string(void);
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
@@ -275,7 +275,9 @@ int MsgIsTwit(GMsg* msg, bool& istwitto, bool& istwitsubj);
|
||||
ulong MsgHasReplies(GMsg* msg);
|
||||
gkey ViewMessage(int istwit=NOT_TWIT);
|
||||
int LoadMessage(GMsg* msg, int margin);
|
||||
#ifdef OLD_STYLE_HEADER
|
||||
void DispHeader(GMsg* msg, bool prn, FILE* fp=NULL, int width=-1);
|
||||
#endif
|
||||
void LoadRawMsg(GMsg* msg, int margin);
|
||||
|
||||
void make_pathreport(char* reportfile);
|
||||
@@ -387,7 +389,6 @@ void ScanMsgTxtForAddr(GMsg* msg);
|
||||
gkey SearchKey(gkey key, list<CmdKey>::iterator keys, int totkeys);
|
||||
int SearchTaglist(Echo* taglist, char* tag);
|
||||
void set_title(const char* t, int p, int a);
|
||||
char* strconv(char* str, char* conv);
|
||||
void title_shadow();
|
||||
void update_statusline(const char* info);
|
||||
void update_statuslinef(const char* format, ...) __attribute__ ((format (printf, 1, 2)));
|
||||
|
@@ -114,7 +114,9 @@ int TemplateToText(int mode, GMsg* msg, GMsg* oldmsg, const char* tpl, int origa
|
||||
TPLTOKEN_QUOTE,
|
||||
TPLTOKEN_INCLUDE,
|
||||
TPLTOKEN_MESSAGE,
|
||||
TPLTOKEN_MODERATOR
|
||||
TPLTOKEN_MODERATOR,
|
||||
TPLTOKEN_WRITE,
|
||||
TPLTOKEN_HEADER
|
||||
};
|
||||
|
||||
#define CSTR_COMMA_SIZEOF_CSTR(s) s, (sizeof(s)-1)
|
||||
@@ -150,7 +152,9 @@ int TemplateToText(int mode, GMsg* msg, GMsg* oldmsg, const char* tpl, int origa
|
||||
{ CSTR_COMMA_SIZEOF_CSTR("quote") },
|
||||
{ CSTR_COMMA_SIZEOF_CSTR("include") },
|
||||
{ CSTR_COMMA_SIZEOF_CSTR("message") },
|
||||
{ CSTR_COMMA_SIZEOF_CSTR("moderator") }
|
||||
{ CSTR_COMMA_SIZEOF_CSTR("moderator") },
|
||||
{ CSTR_COMMA_SIZEOF_CSTR("write") },
|
||||
{ CSTR_COMMA_SIZEOF_CSTR("header") }
|
||||
};
|
||||
|
||||
int end_token = sizeof(token_list) / sizeof(tpl_token);
|
||||
@@ -197,6 +201,12 @@ int TemplateToText(int mode, GMsg* msg, GMsg* oldmsg, const char* tpl, int origa
|
||||
mktemp(strcpy(tplfile, AddPath(CFG->templatepath, "GDXXXXXX")));
|
||||
fp = fsopen(tplfile, "wt", CFG->sharemode);
|
||||
if(fp) {
|
||||
fputs("@header= @oecho (@caddr) @align{79}{=}\n", fp);
|
||||
fputs("@header Msg : @msgno of @msgs@align{44}@attr\n", fp);
|
||||
fputs("@header From : @_oname @_oaddr @odate @otime\n", fp);
|
||||
fputs("@header To : @dname\n", fp);
|
||||
fputs("@header Subj : @subject\n", fp);
|
||||
fputs("@header@align{79}{=}\n", fp);
|
||||
fputs("@moved* Replying to a msg in @oecho (@odesc)\n@moved\n", fp);
|
||||
fputs("@changed* Changed by @cname (@caddr), @cdate @ctime.\n@changed\n", fp);
|
||||
fputs("@forward* Forwarded from @oecho by @fname (@faddr).\n", fp);
|
||||
@@ -334,6 +344,20 @@ int TemplateToText(int mode, GMsg* msg, GMsg* oldmsg, const char* tpl, int origa
|
||||
token = end_token;
|
||||
break;
|
||||
|
||||
case TPLTOKEN_HEADER:
|
||||
if((mode != MODE_HEADER) and (mode != MODE_WRITEHEADER))
|
||||
goto loop_next;
|
||||
chg = YES;
|
||||
token = end_token;
|
||||
break;
|
||||
|
||||
case TPLTOKEN_WRITE:
|
||||
if((mode != MODE_WRITE) and (mode != MODE_WRITEHEADER))
|
||||
goto loop_next;
|
||||
chg = YES;
|
||||
token = end_token;
|
||||
break;
|
||||
|
||||
case TPLTOKEN_NET:
|
||||
if(not AA->isnet())
|
||||
goto loop_next;
|
||||
@@ -682,7 +706,8 @@ int TemplateToText(int mode, GMsg* msg, GMsg* oldmsg, const char* tpl, int origa
|
||||
continue;
|
||||
|
||||
case TPLTOKEN_MESSAGE:
|
||||
if(mode == MODE_FORWARD or mode == MODE_CHANGE) {
|
||||
if((mode == MODE_FORWARD) or (mode == MODE_CHANGE) or
|
||||
(mode == MODE_WRITEHEADER) or (mode == MODE_WRITE)) {
|
||||
n = 0;
|
||||
while(oldmsg->line[n]) {
|
||||
if(oldmsg->line[n]->txt.c_str()) {
|
||||
@@ -734,7 +759,7 @@ int TemplateToText(int mode, GMsg* msg, GMsg* oldmsg, const char* tpl, int origa
|
||||
}
|
||||
}
|
||||
|
||||
if(mode == MODE_CHANGE)
|
||||
if((mode == MODE_CHANGE) or (mode == MODE_WRITEHEADER) or (mode == MODE_WRITE))
|
||||
if(chg == NO)
|
||||
continue;
|
||||
if((mode == MODE_QUOTEBUF) and not quotebufline)
|
||||
@@ -751,7 +776,9 @@ int TemplateToText(int mode, GMsg* msg, GMsg* oldmsg, const char* tpl, int origa
|
||||
}
|
||||
fclose(fp);
|
||||
|
||||
if((mode != MODE_CHANGE) and (mode != MODE_QUOTEBUF)) {
|
||||
if((mode != MODE_CHANGE) and (mode != MODE_QUOTEBUF) and
|
||||
(mode != MODE_HEADER) and (mode != MODE_WRITEHEADER) and
|
||||
(mode != MODE_WRITE) and (mode != MODE_WRITEHEADER)) {
|
||||
ctrlinfo = AA->Ctrlinfo();
|
||||
ctrlinfo |= CI_TAGL;
|
||||
if(ctrlinfo & (CI_TAGL|CI_TEAR|CI_ORIG)) {
|
||||
|
@@ -779,9 +779,9 @@ void guserbase::update_addressbook(GMsg* msg, bool reverse, bool force) {
|
||||
return;
|
||||
|
||||
// Update address
|
||||
if(AA->isinternet())
|
||||
if(AA->isinternet() or (not *entry.iaddr and *iaddr))
|
||||
strxcpy(entry.iaddr, iaddr, sizeof(entry.iaddr));
|
||||
else
|
||||
if(not AA->isinternet() and not (AA->Internetgate().addr.valid() and (fidoaddr == AA->Internetgate().addr)))
|
||||
entry.fidoaddr = fidoaddr;
|
||||
|
||||
lock();
|
||||
@@ -824,8 +824,12 @@ bool guserbase::lookup_addressbook(GMsg* msg, char* name, char* aka, bool browse
|
||||
if(strblank(aka) and not strblank(entry.iaddr)) {
|
||||
// do UUCP addressing
|
||||
strcpy(msg->realto, entry.name);
|
||||
strcpy(name, entry.iaddr);
|
||||
strcpy(msg->idest, entry.iaddr);
|
||||
strcpy(msg->iaddr, entry.iaddr);
|
||||
if(AA->Internetgate().addr.valid())
|
||||
AA->Internetgate().addr.make_string(aka);
|
||||
if(*AA->Internetgate().name)
|
||||
strcpy(name, AA->Internetgate().name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -852,9 +856,11 @@ void guserbase::build_pseudo(GMsg* msg, char* name, char* aka, bool direction) {
|
||||
return;
|
||||
}
|
||||
else {
|
||||
Addr AKA = aka;
|
||||
if(entry.fidoaddr != AKA)
|
||||
return;
|
||||
if(entry.fidoaddr.valid()) {
|
||||
Addr AKA = aka;
|
||||
if(entry.fidoaddr != AKA)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
strcpy(direction ? msg->pseudoto : msg->pseudofrom, entry.pseudo);
|
||||
|
@@ -257,7 +257,7 @@ void ScreenBlankIdle() {
|
||||
char blankmsg1[80];
|
||||
char blankmsg2[80];
|
||||
time_t t = time(NULL);
|
||||
sprintf(blankmsg1, " %s %s ", __gver_longpid__, strftimei(blankmsg2, 40, LNG->StatusLineTimeFmt, localtime(&t)));
|
||||
sprintf(blankmsg1, " %s %s %s ", __gver_longpid__, __gver_ver__, strftimei(blankmsg2, 40, LNG->StatusLineTimeFmt, localtime(&t)));
|
||||
sprintf(blankmsg2, " %s ", LNG->BlankMsg);
|
||||
if(strblank(blankmsg2)) {
|
||||
*blankmsg2 = NUL;
|
||||
|
@@ -101,18 +101,18 @@ void GMsgHeaderView::Paint() {
|
||||
headerline[width] = NUL;
|
||||
|
||||
INam whofrom;
|
||||
if(*msg->ifrom and *msg->realby)
|
||||
if(not area->isecho() and *msg->ifrom and *msg->realby)
|
||||
sprintf(whofrom, "%s <%s>", msg->realby, msg->iorig);
|
||||
else if(*msg->ifrom and *msg->iorig)
|
||||
else if(not area->isecho() and *msg->ifrom and *msg->iorig)
|
||||
strcpy(whofrom, msg->iorig);
|
||||
else
|
||||
strcpy(whofrom, msg->By());
|
||||
strsetsz(whofrom, (area->isinternet() or *msg->ifrom) ? (namewidth+nodewidth) : namewidth);
|
||||
|
||||
INam whoto;
|
||||
if(*msg->ito and *msg->realto)
|
||||
if(not area->isecho() and *msg->ito and *msg->realto)
|
||||
sprintf(whoto, "%s <%s>", msg->realto, msg->idest);
|
||||
else if(*msg->ito and *msg->idest)
|
||||
else if(not area->isecho() and *msg->ito and *msg->idest)
|
||||
strcpy(whoto, msg->idest);
|
||||
else
|
||||
strcpy(whoto, msg->To());
|
||||
@@ -266,9 +266,9 @@ void GMsgHeaderView::Paint() {
|
||||
window.prints(3, 0, window_color, LNG->To);
|
||||
window.prints(3, CFG->disphdrnameset.pos, ((msg->foundwhere&GFIND_TO) or msg->attr.tou()) ? highlight_color : to_color, whoto);
|
||||
if(not area->isinternet()) {
|
||||
if(not (*msg->ifrom and (*msg->realby or *msg->iorig)))
|
||||
if(area->isecho() or not (*msg->ifrom and (*msg->realby or *msg->iorig)))
|
||||
window.prints(2, CFG->disphdrnodeset.pos, from_color, node1);
|
||||
if(not (*msg->ito and (*msg->realto or *msg->idest)))
|
||||
if(area->isecho() or not (*msg->ito and (*msg->realto or *msg->idest)))
|
||||
window.prints(3, CFG->disphdrnodeset.pos, to_color, node2);
|
||||
}
|
||||
window.prints(2, CFG->disphdrdateset.pos, from_color, date1);
|
||||
|
@@ -29,15 +29,18 @@
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
#define __GVER_PID__(A,B,C,SIZE) __GVER_PRE##SIZE##NAME__ __GVER_##SIZE##NAME__ __GVER_POST##SIZE##NAME__ __GVER_##SIZE##PLATFORM__ " " \
|
||||
__GVER_PREVERSION__ #A "." #B "." #C __GVER_POSTVERSION__
|
||||
#define __GVER_PID__(A,SIZE) __GVER_PRE##SIZE##NAME__ __GVER_##SIZE##NAME__ __GVER_POST##SIZE##NAME__ __GVER_##SIZE##PLATFORM__
|
||||
#define __GVER_VER__(A,B,C) __GVER_PREVERSION__ #A "." #B "." #C __GVER_POSTVERSION__
|
||||
#define __GVER_SVER__(A,B,C) #A "." #B "." #C
|
||||
|
||||
#define __GVER__(__GVER_MAJOR__,__GVER_MINOR__,__GVER_RELEASE__) \
|
||||
int __gver_major__ = __GVER_MAJOR__; \
|
||||
int __gver_minor__ = __GVER_MINOR__; \
|
||||
int __gver_release__ = __GVER_RELEASE__; \
|
||||
const char* __gver_longpid__ = __GVER_PID__(__GVER_MAJOR__,__GVER_MINOR__,__GVER_RELEASE__,); \
|
||||
const char* __gver_shortpid__ = __GVER_PID__(__GVER_MAJOR__,__GVER_MINOR__,__GVER_RELEASE__,SHORT);
|
||||
const char* __gver_longpid__ = __GVER_PID__(,); \
|
||||
const char* __gver_shortpid__ = __GVER_PID__(,SHORT); \
|
||||
const char* __gver_ver__ = __GVER_VER__(__GVER_MAJOR__,__GVER_MINOR__,__GVER_RELEASE__);
|
||||
const char* __gver_shortver__ = __GVER_SVER__(__GVER_MAJOR__,__GVER_MINOR__,__GVER_RELEASE__);
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user