From 662a63b5651d4274425140cd0b705e318a8d24bc Mon Sep 17 00:00:00 2001 From: piaip Date: Thu, 13 Oct 2011 17:46:02 +0000 Subject: simplify forward signature git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5422 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- pttbbs/include/proto.h | 1 + pttbbs/mbbsd/bbs.c | 5 ++--- pttbbs/mbbsd/edit.c | 13 +++++++++++++ pttbbs/mbbsd/mail.c | 2 +- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/pttbbs/include/proto.h b/pttbbs/include/proto.h index 69a63d10..716fac1e 100644 --- a/pttbbs/include/proto.h +++ b/pttbbs/include/proto.h @@ -196,6 +196,7 @@ int veditfile(const char *fpath); void write_header(FILE *fp, const char *mytitle); void addsignature(FILE *fp, int ifuseanony); void addsimplesignature(FILE *fp, const char *fromhost); +void addforwardsignature(FILE *fp, const char *fromhost); void auto_backup(void); void restore_backup(void); const char *ask_tmpbuf(int y); diff --git a/pttbbs/mbbsd/bbs.c b/pttbbs/mbbsd/bbs.c index d5aa167a..6575f64b 100644 --- a/pttbbs/mbbsd/bbs.c +++ b/pttbbs/mbbsd/bbs.c @@ -2076,9 +2076,7 @@ cross_post(int ent, fileheader_t * fhdr, const char *direct) b_suckinfile(xptr, fname); } - addsimplesignature(xptr, NULL); - fprintf(xptr, "◆ 由 %s 轉錄,時間: %s\n", - cuser.userid, Cdatelite(&now)); + addforwardsignature(xptr, NULL); fclose(xptr); // try to record in ALLPOST @@ -2176,6 +2174,7 @@ cross_post(int ent, fileheader_t * fhdr, const char *direct) #endif } + clrtobot(); pressanykey(); currmode = currmode0; } diff --git a/pttbbs/mbbsd/edit.c b/pttbbs/mbbsd/edit.c index cf30a0c3..fbf586b6 100644 --- a/pttbbs/mbbsd/edit.c +++ b/pttbbs/mbbsd/edit.c @@ -1734,6 +1734,19 @@ loadsitesig(const char *fname) return ret; } +void +addforwardsignature(FILE *fp, const char *host) { + char temp[33]; + if (!host) + host = FROMHOST; + strlcpy(temp, host, sizeof(temp)); + syncnow(); + fprintf(fp, "\n" + "※ 發信站 :" BBSNAME "(" MYHOSTNAME ")\n" + "※ 轉錄者: %s (%s), 時間: %s\n" + , cuser.userid, host, Cdatelite(&now)); +} + void addsimplesignature(FILE *fp, const char *host) { char temp[33]; diff --git a/pttbbs/mbbsd/mail.c b/pttbbs/mbbsd/mail.c index 31799e90..5959ccdb 100644 --- a/pttbbs/mbbsd/mail.c +++ b/pttbbs/mbbsd/mail.c @@ -1629,7 +1629,7 @@ mail_cross_post(int unused_arg, fileheader_t * fhdr, const char *direct) fprintf(xptr, "※ [本文轉錄自 %s 信箱]\n\n", cuser.userid); b_suckinfile(xptr, fname); - addsimplesignature(xptr, NULL); + addforwardsignature(xptr, NULL); fprintf(xptr, "◆ 由 %s 轉錄,時間: %s\n", cuser.userid, Cdatelite(&now)); fclose(xptr); -- cgit v1.2.3