New keywords/features added, see notework

This commit is contained in:
Alexander S. Aganichev 2001-11-06 08:27:18 +00:00
parent 692c95f115
commit 6afc6df423
26 changed files with 488 additions and 305 deletions

View File

@ -88,18 +88,11 @@ QUOTECTRL No
// AreaCFMReplyTo
// Send CFM messages to particular area
// INTERNETSERVER <nntp/smpt> <server>
// INTERNETSERVER <pop3> <server> [<username>] [<password>]
// No code currently associated with this keyword.
// GERMANKEYBOARD <yes/no> (autodetect)
// This option is meanful for w32 version only. Due to right Alt key
// required to enter some native characters in german version of
// Windows it could be defined to yes for this.
// HAPPYBIRTHDAY <value>
// The only valid value is "friend". Currently do nothing.
// LOADLANGUAGE
ELSE

View File

@ -12,6 +12,37 @@ ______________________________________________________________________
Notes for GoldED+ 1.1.5, /snapshot/
______________________________________________________________________
+ Added peek URL feature. Goldkeys.cfg keyword: READPeekURLs, help
topic number is 3018. The behaviour is controlled by the
PeekURLOptions keyword: available parameters are SORT, FROMTOP,
NOTFROMTOP. Selected URL will be processed with the commandline
predefined with URLHANDLER (the token replaced with URL is @url).
Language configuration:
WT_PEEKURL "Available URLs"
ST_PEEKURL "Select URL"
IL_PEEKINFONOURLS " No valid URLs were found in this msg! "
+ Imlemented READExternUtilMenu. You can now process message by
entering command line. Command line executed using EXTERNOPTIONS.
Associated help topic number is 3017. Language configuration:
WT_EXTERNUTIL "External utilities"
ST_EXTERNUTIL "Select external utility to execute"
WT_EXECCMDLINE "Enter command line to execute"
MI_ENTERCMDLINE " Enter command line "
+ Added new keyword InternetViaGate (default to no). Allows usage of
SoupGate with AreaIsEmail. When set to yes GoldED+ will generate
only To: line for e-mail areas, but will also encrypt message header
in quoted printable if enabled by EncodeEmailHeaders keyword.
+ Added new keyword HighlightURLs (default to yes). Allows enable or
disable URLs and emails highlighting.
! Removed HappyBirthday and InternetServer keywords. Anyway, they were
useless.
- Fixed more quirks with charset.
- Fixed quotewrap in internal editor if quotestring contains a space

View File

@ -700,16 +700,18 @@ CfgGed::CfgGed() {
fidouserno = 0;
forcetemplate = false;
frqoptions = FREQ_FROMTOP;
peekurloptions = PEEK_FROMTOP;
gedhandshake = true;
goldbaseuserno = 0;
happybirthday = 0;
hidestylies = false;
highlighturls = true;
hudsonsizewarn = 16000000L;
hudsonuserno = 0;
ignorecharset = false;
intensecolors = false;
internetmsgid = false;
internetrfcbody = false;
internetviagate = false;
keybmode = KEYB_POLL;
logformat = 0;
menumarked = MODE_DONT;
@ -825,11 +827,6 @@ CfgGed::CfgGed() {
*internetgate.name = 0;
internetgateexp = (RFCName << 2) | RFCAddress;
// internetgate.addr.reset();
*internetserver.nntp.server = 0;
*internetserver.smtp.server = 0;
*internetserver.pop3.server = 0;
*internetserver.pop3.username = 0;
*internetserver.pop3.password = 0;
invalidate.origin.first = " * Origin: ";
invalidate.origin.second = " + Origin: ";
invalidate.seenby.first = "SEEN-BY";

View File

@ -200,8 +200,8 @@ const word CRC_GOLDLANG = 0x6800;
const word CRC_GOLDPATH = 0x3411;
const word CRC_GOLDXLAT = 0x7909;
const word CRC_GROUP = 0x1C9B;
const word CRC_HAPPYBIRTHDAY = 0x7279;
const word CRC_HIGHLIGHTUNREAD = 0x45DA;
const word CRC_HIGHLIGHTURLS = 0xC201;
const word CRC_HUDSONPATH = 0x52A7;
const word CRC_HUDSONSIZEWARN = 0x111A;
const word CRC_HUDSONSYSPATH = 0xC716;
@ -223,7 +223,7 @@ const word CRC_INTERNETLOOKUP = 0x0E22;
const word CRC_INTERNETMSGID = 0xC31F;
const word CRC_INTERNETREPLY = 0x6253;
const word CRC_INTERNETRFCBODY = 0x9390;
const word CRC_INTERNETSERVER = 0xA01B;
const word CRC_INTERNETVIAGATE = 0xAE3F;
const word CRC_INVALIDATE = 0x69CB;
const word CRC_JAMHARDDELETE = 0xE2D5;
const word CRC_JAMPATH = 0x1200;
@ -275,6 +275,7 @@ const word CRC_OUTPUTFILE = 0xA697;
const word CRC_PATHREPORTFILE = 0x8700;
const word CRC_PCBOARDPATH = 0xC08B;
const word CRC_PCBOARDUSERNO = 0x6A87;
const word CRC_PEEKURLOPTIONS = 0x6716;
const word CRC_PERSONALMAIL = 0xD340;
const word CRC_PLAY = 0xC6AE;
const word CRC_PRINTDEVICE = 0xA4C3;
@ -359,6 +360,7 @@ const word CRC_TWITMODE = 0x9DC8;
const word CRC_TWITNAME = 0x2055;
const word CRC_TWITSUBJ = 0x08C0;
const word CRC_TWITTO = 0x9DFE;
const word CRC_URLHANDLER = 0x688E;
const word CRC_USEAREA = 0x2FD4;
const word CRC_USECHARSET = 0xE1B9;
const word CRC_USEFLAGS = 0xE2B6;

View File

@ -355,11 +355,11 @@ SwitchG:
SwitchH:
switch(crc) {
case CRC_HAPPYBIRTHDAY : CfgHappybirthday (); break;
case CRC_HUDSONPATH : CfgHudsonpath (); break;
case CRC_HUDSONSIZEWARN : CfgHudsonsizewarn (); break;
case CRC_HUDSONSYSPATH : CfgHudsonsyspath (); break;
case CRC_HUDSONUSERNO : CfgHudsonuserno (); break;
case CRC_HIGHLIGHTURLS : CfgHighlighturls (); break;
default : found = false;
}
goto End;
@ -379,7 +379,7 @@ SwitchI:
case CRC_INTERNETGATEEXP : CfgInternetgateexp (); break;
case CRC_INTERNETMSGID : CfgInternetmsgid (); break;
case CRC_INTERNETRFCBODY : CfgInternetrfcbody (); break;
case CRC_INTERNETSERVER : CfgInternetserver (); break;
case CRC_INTERNETVIAGATE : CfgInternetviagate (); break;
case CRC_INVALIDATE : CfgInvalidate (); break;
default : found = false;
}
@ -456,6 +456,7 @@ SwitchP:
switch(crc) {
case CRC_PCBOARDPATH : CfgPcboardpath (); break;
case CRC_PCBOARDUSERNO : CfgPcboarduserno (); break;
case CRC_PEEKURLOPTIONS : CfgPeekurloptions (); break;
case CRC_PERSONALMAIL : CfgPersonalmail (); break;
case CRC_PLAY : CfgPlay (); break;
case CRC_PRINTDEVICE : CfgPrintdevice (); break;
@ -555,6 +556,7 @@ SwitchT:
SwitchU:
switch(crc) {
case CRC_URLHANDLER : CfgUrlhandler (); break;
case CRC_USEAREA : CfgUsearea (); break;
case CRC_USECHARSET : CfgUsecharset (); break;
case CRC_USEFWD : CfgUsefwd (); break;

View File

@ -36,10 +36,9 @@ extern char* val;
// ------------------------------------------------------------------
void CfgHappybirthday() {
void CfgHighlighturls() {
if(strieql(val, "FRIEND"))
CFG->happybirthday = true;
CFG->highlighturls = GetYesno(val) ? true : false;
}
// ------------------------------------------------------------------
@ -215,34 +214,9 @@ void CfgInternetrfcbody() {
// ------------------------------------------------------------------
void CfgInternetserver() {
void CfgInternetviagate() {
GTok t;
if(t.First(val)) {
int server = 0;
if(strieql(t.Token(), "NNTP"))
server = 1;
else if(strieql(t.Token(), "SMTP"))
server = 2;
else if(strieql(t.Token(), "POP3"))
server = 3;
int parameter = 1;
while(t.Next()) {
if(server == 1)
strxcpy(CFG->internetserver.nntp.server, t.Token(), sizeof(CFG->internetserver.nntp.server));
else if(server == 2)
strxcpy(CFG->internetserver.smtp.server, t.Token(), sizeof(CFG->internetserver.smtp.server));
else if(server == 3) {
if(parameter == 1)
strxcpy(CFG->internetserver.pop3.server, t.Token(), sizeof(CFG->internetserver.pop3.server));
else if(parameter == 2)
strxcpy(CFG->internetserver.pop3.username, t.Token(), sizeof(CFG->internetserver.pop3.username));
else if(parameter == 3)
strxcpy(CFG->internetserver.pop3.password, t.Token(), sizeof(CFG->internetserver.pop3.password));
}
parameter++;
}
}
CFG->internetviagate = GetYesno(val) ? true : false;
}
// ------------------------------------------------------------------

View File

@ -260,6 +260,18 @@ void CfgPcboarduserno() {
// ------------------------------------------------------------------
void CfgPeekurloptions() {
if(striinc("SORT", val))
CFG->peekurloptions |= PEEK_SORT;
if(striinc("FROMTOP", val))
CFG->peekurloptions |= PEEK_FROMTOP;
if(striinc("NOTFROMTOP", val))
CFG->peekurloptions &= ~PEEK_FROMTOP;
}
// ------------------------------------------------------------------
void CfgPersonalmail() {
if(striinc("STARTUP", val))

View File

@ -274,6 +274,13 @@ void CfgTwitsubj() {
// ------------------------------------------------------------------
void CfgUrlhandler() {
CFG->urlhandler = val;
}
// ------------------------------------------------------------------
void CfgUsearea() {
int flag = GetYesno(val) ? true : false;

View File

@ -370,6 +370,7 @@ tglobalkey globalkeys[] = {
{ CRC_K_SEND , Key_S_End , 0 }, // 0x0590
#endif
{ CRC_READGOTOPREVMSG , KK_ReadGotoPrevMsg , KT_R }, // 0x06D9
{ CRC_READPEEKURLS , KK_ReadPeekURLs , KT_R }, // 0x07BA
{ CRC_K_STAB , Key_S_Tab , 0 }, // 0x0886
{ CRC_EDITLOADFILE , KK_EditLoadFile , KT_A }, // 0x0931
{ CRC_READFILEREQUEST , KK_ReadFileRequest , KT_R }, // 0x0A07

View File

@ -264,6 +264,7 @@ const word CRC_READMSGPGDN = 0x4908;
const word CRC_READMSGPGUP = 0x5816;
const word CRC_READNEWAREA = 0xAB5E;
const word CRC_READNEWMSG = 0x30CA;
const word CRC_READPEEKURLS = 0x07BA;
const word CRC_READQUITNOW = 0xAC15;
const word CRC_READQUOTEBUF = 0x49EE;
const word CRC_READQUOTEMSG = 0xBE00;

View File

@ -475,6 +475,15 @@ static LangCrc LangCrcs[] = {
{ CRC_IL_DECODE , NULL , "Decode" },
{ CRC_IL_PREPARING , NULL , "Preparing" },
{ CRC_WT_EXTERNUTIL , NULL , "External utilities" },
{ CRC_ST_EXTERNUTIL , NULL , "Select external utility to execute" },
{ CRC_WT_EXECCMDLINE , NULL , "Enter command line to execute" },
{ CRC_MI_ENTERCMDLINE , NULL , " Enter command line " },
{ CRC_WT_PEEKURL , NULL , "Available URLs" },
{ CRC_ST_PEEKURL , NULL , "Select URL" },
{ CRC_IL_PEEKINFONOURLS , NULL , " No valid URLs were found in this msg! " },
{ CRC_LAST_CRC , NULL , NULL }
};

View File

@ -487,6 +487,15 @@ const word CRC_MI_ALSELECTIONS2 = 0xBFEF;
const word CRC_IL_DECODE = 0x10D9;
const word CRC_IL_PREPARING = 0x2CD6;
const word CRC_MI_ENTERCMDLINE = 0xFF94;
const word CRC_WT_EXECCMDLINE = 0x591D;
const word CRC_ST_EXTERNUTIL = 0x090E;
const word CRC_WT_EXTERNUTIL = 0x5849;
const word CRC_WT_PEEKURL = 0x2A26;
const word CRC_ST_PEEKURL = 0x254B;
const word CRC_IL_PEEKINFONOURLS = 0x361D;
const word CRC_LAST_CRC = 0xFFFF;

View File

@ -194,8 +194,8 @@ void CfgGoldbasesyspath ();
void CfgGoldbaseuserno ();
void CfgGoldpath ();
void CfgGroup ();
void CfgHappybirthday ();
void CfgHighlightunread ();
void CfgHighlighturls ();
void CfgHudsonpath ();
void CfgHudsonsizewarn ();
void CfgHudsonsyspath ();
@ -215,7 +215,7 @@ void CfgInternetlookup ();
void CfgInternetmsgid ();
void CfgInternetreply ();
void CfgInternetrfcbody ();
void CfgInternetserver ();
void CfgInternetviagate ();
void CfgInvalidate ();
void CfgJampath ();
void CfgKeybclear ();
@ -265,6 +265,7 @@ void CfgOutputfile ();
void CfgPathreportfile ();
void CfgPcboardpath ();
void CfgPcboarduserno ();
void CfgPeekurloptions ();
void CfgPersonalmail ();
void CfgPlay ();
void CfgPrintdevice ();
@ -341,6 +342,7 @@ void CfgTwitmode ();
void CfgTwitname ();
void CfgTwitsubj ();
void CfgTwitto ();
void CfgUrlhandler ();
void CfgUsearea ();
void CfgUsecharset ();
void CfgUseflags ();

View File

@ -265,6 +265,13 @@ const int FREQ_NOWAZOOMSG = 0x0010;
const int FREQ_USEFLOWFILE = 0x0020;
// ------------------------------------------------------------------
// Peek URLs options
const int PEEK_SORT = 0x0001;
const int PEEK_FROMTOP = 0x0002;
// ------------------------------------------------------------------
// Automatic echoid names
@ -969,23 +976,6 @@ struct FrqNodeMap {
};
// ------------------------------------------------------------------
struct InetServers {
struct {
char server[61];
} nntp;
struct {
char server[61];
} smtp;
struct {
char server[61];
char username[61];
char password[61];
} pop3;
};
// ------------------------------------------------------------------
typedef char BarList[45];

View File

@ -226,8 +226,8 @@ public:
Path goldbasesyspath;
int goldbaseuserno;
Path goldpath;
int happybirthday;
bool hidestylies;
bool highlighturls;
Path hudsonpath;
long hudsonsizewarn;
Path hudsonsyspath;
@ -244,7 +244,7 @@ public:
int internetgateexp;
bool internetmsgid;
bool internetrfcbody;
InetServers internetserver;
bool internetviagate;
Invalidate invalidate;
Path jampath;
int keybmode;
@ -275,6 +275,7 @@ public:
Path pathreportfile;
Path pcboardpath;
int pcboarduserno;
int peekurloptions;
int personalmail;
GPlay play;
Path printdevice; // p_device;
@ -336,6 +337,7 @@ public:
int twitmode; // showtwits;
std::vector<Node> twitname;
gstrarray twitsubj;
std::string urlhandler;
bool usearea;
bool usecharset;
int usefwd;

View File

@ -54,7 +54,7 @@ static bool in_ftn_domained_address(const char *ptr, const char *txt) {
// ------------------------------------------------------------------
static const char *url_begin(const char *ptr) {
const char *url_begin(const char *ptr) {
if(strnieql(ptr, "http://", 7))
return ptr+7;
@ -89,10 +89,11 @@ void Container::StyleCodeHighlight(const char* text, int row, int col, bool dohi
char* punctchars = CFG->stylecodepunct;
char* stylestopchars = CFG->stylecodestops;
char prevchar = ' ';
bool usestylies = dohide or CFG->usestylies;
if(dohide or CFG->usestylies) {
if(usestylies or CFG->highlighturls) {
while(*ptr) {
if(isstylechar(*ptr)) {
if(usestylies and isstylechar(*ptr)) {
if(strchr(punctchars, prevchar)) {
int bb = 0, bi = 0, bu = 0, br = 0;
const char* beginstyle = ptr;
@ -149,7 +150,7 @@ void Container::StyleCodeHighlight(const char* text, int row, int col, bool dohi
}
}
}
else {
else if(CFG->highlighturls) {
const char *begin;
if((begin = url_begin(ptr)) != NULL) {

View File

@ -434,137 +434,149 @@ void DoKludges(int mode, GMsg* msg, bool attronly) {
line->kludge = GKLUD_RFC;
}
if(*msg->ifrom) {
INam _fromname;
IAdr _fromaddr;
strcpy(buf2, msg->ifrom);
ParseInternetAddr(buf2, _fromname, _fromaddr);
if(_fromname[0] != NUL) {
mime_header_encode(buf2, _fromname, msg);
char quot[2] = "\"";
if((buf2[0] == '\"') or (strpbrk(buf2, " \t") == NULL))
quot[0] = NUL;
sprintf(buf, "%sFrom: %s%s%s <%s>", rfc, quot, buf2, quot, _fromaddr);
if(CFG->internetviagate) {
mime_header_encode(buf2, msg->by, msg);
strxcpy(msg->by, buf2, sizeof(INam));
mime_header_encode(buf2, msg->to, msg);
strxcpy(msg->to, buf2, sizeof(INam));
if(not (msg->attr.frq() or msg->attr.att() or msg->attr.urq())) {
mime_header_encode(buf2, msg->re, msg);
strxcpy(msg->re, buf2, sizeof(ISub));
}
else
sprintf(buf, "%sFrom: %s", rfc, msg->ifrom);
}
else {
if(*msg->ifrom) {
INam _fromname;
IAdr _fromaddr;
strcpy(buf2, msg->ifrom);
ParseInternetAddr(buf2, _fromname, _fromaddr);
if(_fromname[0] != NUL) {
mime_header_encode(buf2, _fromname, msg);
char quot[2] = "\"";
if((buf2[0] == '\"') or (strpbrk(buf2, " \t") == NULL))
quot[0] = NUL;
sprintf(buf, "%sFrom: %s%s%s <%s>", rfc, quot, buf2, quot, _fromaddr);
}
else
sprintf(buf, "%sFrom: %s", rfc, msg->ifrom);
line = AddKludge(line, buf);
line->kludge = GKLUD_RFC;
}
else if(*msg->iorig) {
mime_header_encode(buf2, msg->By(), msg);
if(*buf2) {
char quot[2] = "\"";
if((buf2[0] == '\"') or (strpbrk(buf2, " \t") == NULL))
quot[0] = NUL;
sprintf(buf, "%sFrom: %s%s%s <%s>", rfc, quot, buf2, quot, msg->iorig);
} else
sprintf(buf, "%sFrom: %s", rfc, msg->iorig);
line = AddKludge(line, buf);
line->kludge = GKLUD_RFC;
}
if(AA->isnewsgroup()) {
sprintf(buf, "%sNewsgroups: %s", rfc, strlwr(strcpy(buf2, AA->echoid())));
line = AddKludge(line, buf);
line->kludge = GKLUD_RFC;
}
if(*msg->re) {
mime_header_encode(buf2, msg->re, msg);
sprintf(buf, "%sSubject: %s", rfc, buf2);
line = AddKludge(line, buf);
line->kludge = GKLUD_RFC;
}
struct tm* tm = gmtime(&msg->written);
sprintf(buf, "%sDate: %s, %02d %s %04d %02d:%02d:%02d", rfc,
__gsweekday[tm->tm_wday],
tm->tm_mday, __gsmonth[tm->tm_mon], 1900+tm->tm_year,
tm->tm_hour, tm->tm_min, tm->tm_sec
);
if(AA->Usetzutc())
sprintf(buf + strlen(buf), " %+05d", tzoffset());
line = AddKludge(line, buf);
line->kludge = GKLUD_RFC;
}
else if(*msg->iorig) {
mime_header_encode(buf2, msg->By(), msg);
if(*buf2) {
if(msg->messageid) {
sprintf(buf, "%sMessage-ID: %s", rfc, msg->messageid);
line = AddKludge(line, buf);
line->kludge = GKLUD_RFC;
}
if(msg->references) {
sprintf(buf, "%sReferences: %s", rfc, msg->references);
line = AddKludge(line, buf);
line->kludge = GKLUD_RFC;
}
if(msg->inreplyto) {
sprintf(buf, "%sIn-Reply-To: %s", rfc, msg->inreplyto);
line = AddKludge(line, buf);
line->kludge = GKLUD_RFC;
}
if(*msg->organization) {
sprintf(buf, "%sOrganization: %s", rfc, msg->organization);
line = AddKludge(line, buf);
line->kludge = GKLUD_RFC;
}
sprintf(buf, "%sMIME-Version: 1.0", rfc);
line = AddKludge(line, buf);
line->kludge = GKLUD_RFC;
char encoding[100];
bool isusascii = striinc("ASCII", msg->charset);
bool isqp = not isusascii and IsQuotedPrintable(msg->charset);
if(strnieql(msg->charset, "latin", 5))
Latin2ISO(encoding, msg->charset);
else if(isusascii)
strcpy(encoding, "us-ascii");
else if(isqp)
strcpy(encoding, ExtractPlainCharset(msg->charset));
else
strcpy(encoding, msg->charset);
strlwr(encoding);
sprintf(buf, "%sContent-Type: text/plain; charset=%s", rfc, strlword(encoding));
line = AddKludge(line, buf);
line->kludge = GKLUD_RFC;
sprintf(buf, "%sContent-Transfer-Encoding: %s", rfc, isqp ? "quoted-printable" : isusascii ? "7bit" : "8bit");
line = AddKludge(line, buf);
line->kludge = GKLUD_RFC;
if(*msg->iorig) {
mime_header_encode(buf2, msg->By(), msg);
char quot[2] = "\"";
if((buf2[0] == '\"') or (strpbrk(buf2, " \t") == NULL))
quot[0] = NUL;
sprintf(buf, "%sFrom: %s%s%s <%s>", rfc, quot, buf2, quot, msg->iorig);
} else
sprintf(buf, "%sFrom: %s", rfc, msg->iorig);
line = AddKludge(line, buf);
line->kludge = GKLUD_RFC;
}
sprintf(buf, "%sSender: %s%s%s <%s>", rfc, quot, buf2, quot, msg->iorig);
line = AddKludge(line, buf);
line->kludge = GKLUD_RFC;
}
if(AA->isnewsgroup()) {
sprintf(buf, "%sNewsgroups: %s", rfc, strlwr(strcpy(buf2, AA->echoid())));
line = AddKludge(line, buf);
line->kludge = GKLUD_RFC;
}
if((*msg->ireplyto or *CFG->soupreplyto) and (not streql(*msg->ireplyto ? msg->ireplyto : CFG->soupreplyto, msg->iorig))) {
sprintf(buf, "%sReply-To: %s", rfc, *msg->ireplyto ? msg->ireplyto : CFG->soupreplyto);
line = AddKludge(line, buf);
line->kludge = GKLUD_RFC;
}
if(*msg->re) {
mime_header_encode(buf2, msg->re, msg);
sprintf(buf, "%sSubject: %s", rfc, buf2);
line = AddKludge(line, buf);
line->kludge = GKLUD_RFC;
}
if(striinc("MNEMONIC", msg->charset)) {
sprintf(buf, "%sX-Charset: ISO_8859-1", rfc);
line = AddKludge(line, buf);
line->kludge = GKLUD_RFC;
sprintf(buf, "%sX-Char-Esc: 29", rfc);
line = AddKludge(line, buf);
line->kludge = GKLUD_RFC;
}
struct tm* tm = gmtime(&msg->written);
sprintf(buf, "%sDate: %s, %02d %s %04d %02d:%02d:%02d", rfc,
__gsweekday[tm->tm_wday],
tm->tm_mday, __gsmonth[tm->tm_mon], 1900+tm->tm_year,
tm->tm_hour, tm->tm_min, tm->tm_sec
);
if(AA->Usetzutc())
sprintf(buf + strlen(buf), " %+05d", tzoffset());
line = AddKludge(line, buf);
line->kludge = GKLUD_RFC;
if(msg->messageid) {
sprintf(buf, "%sMessage-ID: %s", rfc, msg->messageid);
line = AddKludge(line, buf);
line->kludge = GKLUD_RFC;
}
if(msg->references) {
sprintf(buf, "%sReferences: %s", rfc, msg->references);
line = AddKludge(line, buf);
line->kludge = GKLUD_RFC;
}
if(msg->inreplyto) {
sprintf(buf, "%sIn-Reply-To: %s", rfc, msg->inreplyto);
line = AddKludge(line, buf);
line->kludge = GKLUD_RFC;
}
if(*msg->organization) {
sprintf(buf, "%sOrganization: %s", rfc, msg->organization);
line = AddKludge(line, buf);
line->kludge = GKLUD_RFC;
}
sprintf(buf, "%sMIME-Version: 1.0", rfc);
line = AddKludge(line, buf);
line->kludge = GKLUD_RFC;
char encoding[100];
bool isusascii = striinc("ASCII", msg->charset);
bool isqp = not isusascii and IsQuotedPrintable(msg->charset);
if(strnieql(msg->charset, "latin", 5))
Latin2ISO(encoding, msg->charset);
else if(isusascii)
strcpy(encoding, "us-ascii");
else if(isqp)
strcpy(encoding, ExtractPlainCharset(msg->charset));
else
strcpy(encoding, msg->charset);
strlwr(encoding);
sprintf(buf, "%sContent-Type: text/plain; charset=%s", rfc, strlword(encoding));
line = AddKludge(line, buf);
line->kludge = GKLUD_RFC;
sprintf(buf, "%sContent-Transfer-Encoding: %s", rfc, isqp ? "quoted-printable" : isusascii ? "7bit" : "8bit");
line = AddKludge(line, buf);
line->kludge = GKLUD_RFC;
if(*msg->iorig) {
mime_header_encode(buf2, msg->By(), msg);
char quot[2] = "\"";
if((buf2[0] == '\"') or (strpbrk(buf2, " \t") == NULL))
quot[0] = NUL;
sprintf(buf, "%sSender: %s%s%s <%s>", rfc, quot, buf2, quot, msg->iorig);
line = AddKludge(line, buf);
line->kludge = GKLUD_RFC;
}
if((*msg->ireplyto or *CFG->soupreplyto) and (not streql(*msg->ireplyto ? msg->ireplyto : CFG->soupreplyto, msg->iorig))) {
sprintf(buf, "%sReply-To: %s", rfc, *msg->ireplyto ? msg->ireplyto : CFG->soupreplyto);
line = AddKludge(line, buf);
line->kludge = GKLUD_RFC;
}
if(striinc("MNEMONIC", msg->charset)) {
sprintf(buf, "%sX-Charset: ISO_8859-1", rfc);
line = AddKludge(line, buf);
line->kludge = GKLUD_RFC;
sprintf(buf, "%sX-Char-Esc: 29", rfc);
line = AddKludge(line, buf);
line->kludge = GKLUD_RFC;
}
if(AA->isnewsgroup() or AA->isemail()) {
sprintf(buf, "%sX-%s: %s", rfc, AA->isnewsgroup() ? "Newsreader" : "Mailreader", get_informative_string());
line = AddKludge(line, buf);
line->kludge = GKLUD_RFC;
if(AA->isnewsgroup() or AA->isemail()) {
sprintf(buf, "%sX-%s: %s", rfc, AA->isnewsgroup() ? "Newsreader" : "Mailreader", get_informative_string());
line = AddKludge(line, buf);
line->kludge = GKLUD_RFC;
}
}
if(AA->Internetrfcbody() and line->next and not strblank(line->next->txt.c_str())) {
@ -572,12 +584,16 @@ void DoKludges(int mode, GMsg* msg, bool attronly) {
line->kludge = GKLUD_RFC;
}
}
if(((mode != MODE_CHANGE) or AA->Internetrfcbody()) and AA->isnet() and not AA->isinternet()) {
else if(((mode != MODE_CHANGE) or AA->Internetrfcbody()) and AA->isnet()) {
if(*msg->ito) {
sprintf(buf, "To: %s\r", msg->ito);
sprintf(buf, "To: %s", msg->ito);
line = AddKludge(line, buf);
line->kludge = GKLUD_RFC;
if(AA->Internetrfcbody() and line->next and not strblank(line->next->txt.c_str())) {
line = AddKludge(line, "");
line->kludge = GKLUD_RFC;
}
}
}
}

View File

@ -78,6 +78,8 @@
#define H_MenuConfirm 3014
#define H_GotoReplies 3015
#define H_ReplyThread 3016
#define H_ReadExternUtil 3017
#define H_PeekURL 3018
// ------------------------------------------------------------------

View File

@ -310,6 +310,7 @@ const gkey KK_ReadUUDecode = 0xFFA0;
const gkey KK_ReadWriteMsg = 0xFFA1;
const gkey KK_ReadDirQuoteMsg = 0xFFA2;
const gkey KK_ReadMoveDirQuoteMsg = 0xFFA3;
const gkey KK_ReadPeekURLs = 0xFFA4;
const gkey KK_AddressbookQuit = 0xFFB0;
const gkey KK_AddressbookAdd = 0xFFB1;

View File

@ -462,7 +462,14 @@ struct LangGed {
char* Decode; // IL_DECODE
char* Preparing; // MI_PREPARING
char* ExternUtil; // WT_EXTERNUTIL
char* SelectExternUtil; // ST_EXTERNUTIL
char* ExecCmdLine; // WT_EXECCMDLINE
char* EnterCmdLine; // MI_ENTERCMDLINE
char* PeekURLMenuTitle; // WT_PEEKURL
char* PeekURLStat; // ST_PEEKURL
char* PeekInfoNoURLs; // IL_PEEKINFONOURLS
char* EndLanguage; // LAST_CRC

View File

@ -291,7 +291,8 @@ void PrevArea();
void Reader();
void UpdateArea(GMsg* msg);
int ExternUtil(GMsg* __msg, int __utilno);
void ExternUtilMenu();
void ExternUtilMenu(GMsg* msg);
void ReadPeekURLs(GMsg* msg);
uint next_msg(int direction);
void ChangeAttributes();
@ -453,6 +454,11 @@ inline char *spanfeeds(const char *str) {
bool isuucp(const char *name);
// ------------------------------------------------------------------
const char *url_begin(const char *ptr);
// ------------------------------------------------------------------
#endif

View File

@ -707,7 +707,11 @@ void Reader() {
break;
case KK_ReadExternUtilMenu:
ExternUtilMenu();
ExternUtilMenu(msg);
break;
case KK_ReadPeekURLs:
ReadPeekURLs(msg);
break;
case KK_ReadAddressbookAdd:

View File

@ -521,82 +521,89 @@ void TouchNetscan(int popup) {
// ------------------------------------------------------------------
int ExternUtil(GMsg* msg, int utilno) {
int ExternUtil(GMsg *msg, ExtUtil *extutil) {
Path editorfile, tmpfile;
strcpy(editorfile, AddPath(CFG->goldpath, EDIT->File()));
Path editorfile, tmpfile, buf;
strxcpy(editorfile, AddPath(CFG->goldpath, EDIT->File()), sizeof(Path));
char cmdline[1024];
strxcpy(cmdline, extutil->cmdline, sizeof(cmdline));
int mode = (extutil->options & EXTUTIL_KEEPCTRL) ? MODE_SAVE : MODE_SAVENOCTRL;
SaveLines(mode, editorfile, msg, 79);
strcpy(buf, editorfile);
strchg(buf, GOLD_WRONG_SLASH_CHR, GOLD_SLASH_CHR);
strischg(cmdline, "@file", buf);
if(striinc("@tmpfile", cmdline)) {
mktemp(strcpy(tmpfile, AddPath(CFG->goldpath, "GDXXXXXX")));
SaveLines(mode, tmpfile, msg, 79);
strcpy(buf, tmpfile);
strchg(buf, GOLD_WRONG_SLASH_CHR, GOLD_SLASH_CHR);
strischg(cmdline, "@tmpfile", buf);
}
else
tmpfile[0] = NUL;
strcpy(buf, CFG->goldpath);
strchg(buf, GOLD_WRONG_SLASH_CHR, GOLD_SLASH_CHR);
strischg(cmdline, "@path", buf);
TokenXlat(MODE_NEW, cmdline, msg, msg, CurrArea);
int pauseval = 0;
if(extutil->options & EXTUTIL_PAUSEONERROR)
pauseval = -1;
if(extutil->options & EXTUTIL_PAUSE)
pauseval = 1;
ShellToDos(cmdline, "",
extutil->options & EXTUTIL_CLS ? LGREY|_BLACK : 0,
extutil->options & EXTUTIL_CURSOR,
pauseval
);
if(extutil->options & EXTUTIL_RELOAD) {
if(not (extutil->options & EXTUTIL_KEEPCTRL)) {
if(*msg->tearline or *msg->origin) {
gfile fp;
fp.fopen(editorfile, "at");
if(fp.isopen()) {
if(*msg->tearline)
fp.printf("--- %s\n", msg->tearline);
if(*msg->origin)
fp.printf(" * Origin: %s\n", msg->origin);
fp.fclose();
}
}
}
int hardlines = EDIT->HardLines();
EDIT->HardLines(false);
LoadText(msg, editorfile);
if(extutil->options & EXTUTIL_WIPE)
WipeFile(editorfile, 0);
if(tmpfile[0] != NUL)
WipeFile(tmpfile, 0);
EDIT->HardLines(hardlines);
msg->attr.tou1(); // Ignore any kludge address found
msg->TextToLines(CFG->dispmargin-(int)CFG->switches.get(disppagebar));
msg->attr.tou0();
}
return YES;
}
// ------------------------------------------------------------------
int ExternUtil(GMsg *msg, int utilno) {
std::vector<ExtUtil>::iterator extutil = CFG->externutil.begin();
for(int utlno=0; extutil != CFG->externutil.end(); utlno++, extutil++) {
if(extutil->utilno == utilno) {
char cmdline[256], buf[256];
strcpy(cmdline, extutil->cmdline);
int mode = (extutil->options & EXTUTIL_KEEPCTRL) ? MODE_SAVE : MODE_SAVENOCTRL;
SaveLines(mode, editorfile, msg, 79);
strcpy(buf, editorfile);
strchg(buf, GOLD_WRONG_SLASH_CHR, GOLD_SLASH_CHR);
strischg(cmdline, "@file", buf);
if(striinc("@tmpfile", cmdline)) {
mktemp(strcpy(tmpfile, AddPath(CFG->goldpath, "GDXXXXXX")));
SaveLines(mode, tmpfile, msg, 79);
strcpy(buf, tmpfile);
strchg(buf, GOLD_WRONG_SLASH_CHR, GOLD_SLASH_CHR);
strischg(cmdline, "@tmpfile", buf);
}
else
tmpfile[0] = NUL;
strcpy(buf, CFG->goldpath);
strchg(buf, GOLD_WRONG_SLASH_CHR, GOLD_SLASH_CHR);
strischg(cmdline, "@path", buf);
TokenXlat(MODE_NEW, cmdline, msg, msg, CurrArea);
int pauseval = 0;
if(extutil->options & EXTUTIL_PAUSEONERROR)
pauseval = -1;
if(extutil->options & EXTUTIL_PAUSE)
pauseval = 1;
ShellToDos(cmdline, "",
extutil->options & EXTUTIL_CLS ? LGREY|_BLACK : 0,
extutil->options & EXTUTIL_CURSOR,
pauseval
);
if(extutil->options & EXTUTIL_RELOAD) {
if(not (extutil->options & EXTUTIL_KEEPCTRL)) {
if(*msg->tearline or *msg->origin) {
gfile fp;
fp.fopen(editorfile, "at");
if(fp.isopen()) {
if(*msg->tearline)
fp.printf("--- %s\n", msg->tearline);
if(*msg->origin)
fp.printf(" * Origin: %s\n", msg->origin);
fp.fclose();
}
}
}
int hardlines = EDIT->HardLines();
EDIT->HardLines(false);
LoadText(msg, editorfile);
if(extutil->options & EXTUTIL_WIPE)
WipeFile(editorfile, 0);
if(tmpfile[0] != NUL)
WipeFile(tmpfile, 0);
EDIT->HardLines(hardlines);
msg->attr.tou1(); // Ignore any kludge address found
msg->TextToLines(CFG->dispmargin-(int)CFG->switches.get(disppagebar));
msg->attr.tou0();
}
return YES;
return ExternUtil(msg, extutil);
}
}
@ -607,9 +614,149 @@ int ExternUtil(GMsg* msg, int utilno) {
// ------------------------------------------------------------------
void ExternUtilMenu() {
void ExternUtilMenu(GMsg* msg) {
int n;
std::vector<ExtUtil>::iterator i;
static int startat = 0;
char** Listi;
char buf[100];
static char cmdline[1024] = "";
// Not implemented yet
Listi = (char**)throw_calloc(CFG->externutil.size()+2, sizeof(char*));
Listi[0] = throw_strdup(LNG->EnterCmdLine);
for(i = CFG->externutil.begin(), n=1; i != CFG->externutil.end(); n++, i++) {
sprintf(buf, " %02d %.59s%s ", i->utilno, i->cmdline, strlen(i->cmdline) > 59 ? ">" : "" );
Listi[n] = throw_strdup(buf);
}
n = MinV(n, (MAXROW-10));
set_title(LNG->ExternUtil, TCENTER, C_ASKT);
update_statusline(LNG->SelectExternUtil);
whelppcat(H_ReadExternUtil);
n = wpickstr(6, 0, 6+n+1, -1, W_BASK, C_ASKB, C_ASKW, C_ASKS, Listi, startat, title_shadow);
whelpop();
if(n != -1) {
if(n == 0) {
if(edit_string(cmdline, sizeof(cmdline), LNG->ExecCmdLine, H_ReadExternUtil)) {
ExtUtil extutil;
extutil.utilno = 0;
strxcpy(extutil.cmdline, cmdline, sizeof(extutil.cmdline));
extutil.options = CFG->externoptions;
ExternUtil(msg, &extutil);
}
}
else {
ExternUtil(msg, &CFG->externutil[n-1]);
}
}
for(n=CFG->externutil.size()+1; n; n--)
throw_free(Listi[n-1]);
throw_free(Listi);
}
// ------------------------------------------------------------------
static int PeekURLCmp(const char** a, const char** b) {
return stricmp(*a, *b);
}
// ------------------------------------------------------------------
void ReadPeekURLs(GMsg* msg) {
Line **lin = msg->line;
const char *ptr, *end, *begin;
char buf[256];
std::vector<char *> urls;
std::vector<char *>::iterator i;
int n;
w_info(LNG->Wait);
// Scan the current msg for urls
int tline = reader_topline;
if(CFG->peekurloptions & PEEK_FROMTOP)
tline = 0;
for(n=tline; n<msg->lines; n++) {
ptr = lin[n]->txt.c_str();
while(*ptr) {
if(((begin = url_begin(ptr)) != NULL) and not strneql(ptr, "mailto:", 7)) {
end = begin+strcspn(begin, " \t\"\'<>()[]");
if(ispunct(end[-1]) and (end[-1] != '/'))
--end;
if(begin < end) {
buf[0] = ' ';
strxcpy(buf+1, ptr, MinV((end-ptr)+1, MAXCOL-2-2-2));
strcat(buf, " ");
for(i = urls.begin(); i != urls.end(); i++)
if(strieql(*i, buf))
break;
if(i == urls.end())
urls.push_back(throw_strdup(buf));
ptr = end-1;
}
}
ptr++;
}
}
w_info(NULL);
if(not urls.empty()) {
char** Listi = (char**)throw_calloc(urls.size()+1, sizeof(char*));
for(n = 0, i = urls.begin(); i != urls.end(); i++, n++)
Listi[n] = *i;
// Sort list if requested
if(CFG->peekurloptions & FREQ_SORT)
qsort(Listi, urls.size(), sizeof(char*), (StdCmpCP)PeekURLCmp);
// Run the picker
n = MinV((int)urls.size(), (MAXROW-10));
set_title(LNG->PeekURLMenuTitle, TCENTER, C_ASKT);
update_statusline(LNG->PeekURLStat);
whelppcat(H_PeekURL);
n = wpickstr(6, 0, 6+n+1, -1, W_BASK, C_ASKB, C_ASKW, C_ASKS, Listi, 0, title_shadow);
whelpop();
if(n != -1) {
char cmdline[1024];
strxcpy(cmdline, CFG->urlhandler.c_str(), sizeof(cmdline));
strxmerge(buf, sizeof(buf), "\"", strtrim(strltrim(Listi[n])), "\"", NULL);
strischg(cmdline, "@url", buf);
strxcpy(buf, CFG->goldpath, sizeof(buf));
strchg(buf, GOLD_WRONG_SLASH_CHR, GOLD_SLASH_CHR);
strischg(cmdline, "@path", buf);
TokenXlat(MODE_NEW, cmdline, msg, msg, CurrArea);
int pauseval = 0;
if(CFG->externoptions & EXTUTIL_PAUSEONERROR)
pauseval = -1;
if(CFG->externoptions & EXTUTIL_PAUSE)
pauseval = 1;
ShellToDos(cmdline, "",
CFG->externoptions & EXTUTIL_CLS ? LGREY|_BLACK : 0,
CFG->externoptions & EXTUTIL_CURSOR,
pauseval
);
}
for(n = 0, i = urls.begin(); i != urls.end(); i++, n++)
throw_free(Listi[n]);
throw_free(Listi);
}
else {
w_info(LNG->PeekInfoNoURLs);
waitkeyt(10000);
w_info(NULL);
}
}

View File

@ -439,8 +439,8 @@ void GMsgBodyView::PaintLine(int row, Line *line) {
}
else
StyleCodeHighlight(line->txt.c_str(), vrow, 0, not AA->attr().hex() and CFG->hidestylies, color);
int tlen = strlen(line->txt.c_str());
vputns(vrow, tlen, color, "", visible_width-tlen);
int tlen = strlen(line->txt.c_str());
vputns(vrow, tlen, color, "", visible_width-tlen);
}
else
vputns(vrow, 0, color, line->txt.c_str(), visible_width);

View File

@ -4479,14 +4479,6 @@ AREASEP &excl;C "Group C" C Local]]></eg>
details.
</p>
</div2>
<div2>
<head>
HAPPYBIRTHDAY &lt;value&gt;
</head>
<p>
The only valid value is "friend". Currently do nothing.
</p>
</div2>
<div2>
<head>
HIGHLIGHTUNREAD &lt;yes/no&gt;
@ -4861,20 +4853,6 @@ AREASEP &excl;C "Group C" C Local]]></eg>
allow).
</p>
</div2>
<div2>
<head>
INTERNETSERVER &lt;nntp/smpt&gt; &lt;server&gt;
</head>
<p>
</div2>
<div2>
<head>
INTERNETSERVER &lt;pop3&gt; &lt;server&gt; &lsqb;&lt;username&gt;&rsqb; &lsqb;&lt;password&gt;&rsqb;
</head>
<p>
No code currently associated with this keyword.
</p>
</div2>
<div2>
<head>
INVALIDATE &lt;type&gt; &lt;"findstring"&gt; &lt;"replacestring"&gt;

View File

@ -2850,11 +2850,6 @@ Here is the complete keyword list:
details.
HAPPYBIRTHDAY <value>
The only valid value is "friend". Currently do nothing.
HIGHLIGHTUNREAD <yes/no> (no)
If enabled, GoldED updates (increases) the "timesread" field in
@ -3106,12 +3101,6 @@ Here is the complete keyword list:
allow).
INTERNETSERVER <nntp/smpt> <server>
INTERNETSERVER <pop3> <server> [<username>] [<password>]
No code currently associated with this keyword.
INVALIDATE <type> <"findstring"> <"replacestring">
This is used to invalidate (change) certain control strings in