optimization

This commit is contained in:
Ianos Gnatiuc 2005-10-25 04:15:53 +00:00
parent 1544629b43
commit f602e0d3e3

View File

@ -222,51 +222,51 @@ int TemplateToText(int mode, GMsg* msg, GMsg* oldmsg, const char* tpl, int origa
if(strieql(tplfile, "built-in") or not fexist(tplfile) or CFG->tpl.empty()) { if(strieql(tplfile, "built-in") or not fexist(tplfile) or CFG->tpl.empty()) {
tmptpl = YES; // Create a temporary template tmptpl = YES; // Create a temporary template
mktemp(strcpy(tplfile, AddPath(CFG->temppath, "GDXXXXXX"))); mktemp(strcpy(tplfile, AddPath(CFG->temppath, "GDXXXXXX")));
fp = fsopen(tplfile, "wt", CFG->sharemode);
if(fp) { if ((fp = fsopen(tplfile, "wt", CFG->sharemode)) != NULL)
fputs("@header= @oecho (@caddr) @align{79}{=}\n", fp); {
fputs("@header Msg : @msgno of @msgs@align{44}@attr\n", fp); fputs("@header= @oecho (@caddr) @align{79}{=}\n"
"@header Msg : @msgno of @msgs@align{44}@attr\n", fp);
if (AA->isinternet()) if (AA->isinternet())
{ {
fputs("@header From : @ofrom@align{60}@odtime\n", fp); fputs("@header From : @ofrom@align{60}@odtime\n"
fputs("@header To : @oto\n", fp); "@header To : @oto\n", fp);
}
else if (AA->isnet())
{
fputs("@header From : @oname@align{44}@oaddr@align{60}@odtime\n", fp);
fputs("@header To : @dname@align{44}@daddr\n", fp);
} }
else else
{ {
fputs("@header From : @oname@align{44}@oaddr@align{60}@odtime\n", fp); fputs("@header From : @oname@align{44}@oaddr@align{60}@odtime\n", fp);
if (AA->isnet())
fputs("@header To : @dname@align{44}@daddr\n", fp);
else
fputs("@header To : @dname\n", fp); fputs("@header To : @dname\n", fp);
} }
fputs("@header Subj : @subject\n", fp); fputs("@header Subj : @subject\n"
fputs("@header@align{79}{=}\n", fp); "@header@align{79}{=}\n"
fputs("@moved* Replying to a msg in @oecho (@odesc)\n@moved\n", fp); "@moved* Replying to a msg in @oecho (@odesc)\n@moved\n"
fputs("@changed* Changed by @cname (@caddr), @cdate @ctime.\n@changed\n", fp); "@changed* Changed by @cname (@caddr), @cdate @ctime.\n@changed\n"
fputs("@forward* Forwarded from @oecho by @fname (@faddr).\n", fp); "@forward* Forwarded from @oecho by @fname (@faddr).\n"
fputs("@forward* Originally by: @oname (@oaddr), @odate @otime.\n", fp); "@forward* Originally by: @oname (@oaddr), @odate @otime.\n"
fputs("@forward* Originally to: @dname{}{}{all}.\n", fp); "@forward* Originally to: @dname{}{}{all}.\n"
fputs("@forward\n", fp); "@forward\n"
fputs("@message\n", fp); "@message\n"
fputs("@forward\n", fp); "@forward\n"
fputs("Hello @pseudo{}{}{everybody}.\n", fp); "Hello @pseudo{}{}{everybody}.\n"
fputs("@new\n", fp); "@new\n"
fputs("@position\n", fp); "@position\n"
fputs("@replyReplying to a msg dated @odate @otime, from @oname{me}{you} to @dname{me}{you}{all}.\n", fp); "@replyReplying to a msg dated @odate @otime, from @oname{me}{you} to @dname{me}{you}{all}.\n"
fputs("@reply@position\n", fp); "@reply@position\n"
fputs("@quoted@odate @otime, @oname{I}{you} wrote to @dname{me}{you}{all}:\n", fp); "@quoted@odate @otime, @oname{I}{you} wrote to @dname{me}{you}{all}:\n"
fputs("@quoted@position\n", fp); "@quoted@position\n"
fputs("@comment@odate @otime, @oname{I}{you} wrote to @dname{me}{you}{all}:\n", fp); "@comment@odate @otime, @oname{I}{you} wrote to @dname{me}{you}{all}:\n"
fputs("@comment@position\n", fp); "@comment@position\n"
fputs("@quotebuf\n", fp); "@quotebuf\n"
fputs("@quotebuf@odate @otime, @oname{I}{you} wrote to @dname{me}{you}{all}:\n", fp); "@quotebuf@odate @otime, @oname{I}{you} wrote to @dname{me}{you}{all}:\n"
fputs("@quotebuf\n", fp); "@quotebuf\n"
fputs("@quote\n\n", fp); "@quote\n\n"
fputs("@cfname\n\n", fp); "@cfname\n\n", fp);
fclose(fp); fclose(fp);
} }
} }