diff options
-rw-r--r-- | pttbbs/include/proto.h | 1 | ||||
-rw-r--r-- | pttbbs/mbbsd/bbs.c | 4 | ||||
-rw-r--r-- | pttbbs/mbbsd/edit.c | 23 | ||||
-rw-r--r-- | pttbbs/mbbsd/mail.c | 4 |
4 files changed, 21 insertions, 11 deletions
diff --git a/pttbbs/include/proto.h b/pttbbs/include/proto.h index 3e862acf..c59320a0 100644 --- a/pttbbs/include/proto.h +++ b/pttbbs/include/proto.h @@ -194,6 +194,7 @@ int vedit2(const char *fpath, int saveheader, int *islocal, char save_title[STRL 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 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 a9ff44f2..bb192e52 100644 --- a/pttbbs/mbbsd/bbs.c +++ b/pttbbs/mbbsd/bbs.c @@ -2026,7 +2026,9 @@ cross_post(int ent, fileheader_t * fhdr, const char *direct) b_suckinfile(xptr, fname); } - addsignature(xptr, 0); + addsimplesignature(xptr, NULL); + fprintf(xptr, "◆ 由 %s 轉錄,時間: %s\n", + cuser.userid, Cdatelite(&now)); fclose(xptr); #ifdef USE_AUTOCPLOG diff --git a/pttbbs/mbbsd/edit.c b/pttbbs/mbbsd/edit.c index a508f047..e041c984 100644 --- a/pttbbs/mbbsd/edit.c +++ b/pttbbs/mbbsd/edit.c @@ -1736,6 +1736,17 @@ loadsitesig(const char *fname) } void +addsimplesignature(FILE *fp, const char *host) { + char temp[33]; + if (!host) + host = FROMHOST; + strlcpy(temp, host, sizeof(temp)); + fprintf(fp, + "\n--\n※ 發信站 :" BBSNAME "(" MYHOSTNAME ") \n" + "◆ From: %s\n", host); +} + +void addsignature(FILE * fp, int ifuseanony) { FILE *fs; @@ -1746,8 +1757,7 @@ addsignature(FILE * fp, int ifuseanony) char ch; if (!strcmp(cuser.userid, STR_GUEST)) { - fprintf(fp, "\n--\n※ 發信站 :" BBSNAME "(" MYHOSTNAME - ") \n◆ From: %s\n", FROMHOST); + addsimplesignature(fp, NULL); return; } if (!ifuseanony) { @@ -1812,16 +1822,11 @@ browse_sigs: #ifdef HAVE_ORIGIN #ifdef HAVE_ANONYMOUS if (ifuseanony) - fprintf(fp, "\n--\n※ 發信站: " BBSNAME "(" MYHOSTNAME - ") \n◆ From: %s\n", "匿名天使的家"); + addsimplesignature(fp, "匿名天使的家"); else #endif { - char temp[33]; - - strlcpy(temp, FROMHOST, sizeof(temp)); - fprintf(fp, "\n--\n※ 發信站: " BBSNAME "(" MYHOSTNAME - ") \n◆ From: %s\n", temp); + addsimplesignature(fp, NULL); } #endif } diff --git a/pttbbs/mbbsd/mail.c b/pttbbs/mbbsd/mail.c index f6b63248..92894cf2 100644 --- a/pttbbs/mbbsd/mail.c +++ b/pttbbs/mbbsd/mail.c @@ -1621,7 +1621,9 @@ mail_cross_post(int unused_arg, fileheader_t * fhdr, const char *direct) fprintf(xptr, "※ [本文轉錄自 %s 信箱]\n\n", cuser.userid); b_suckinfile(xptr, fname); - addsignature(xptr, 0); + addsimplesignature(xptr, NULL); + fprintf(xptr, "◆ 由 %s 轉錄,時間: %s\n", + cuser.userid, Cdatelite(&now)); fclose(xptr); } |