diff options
-rw-r--r-- | pttbbs/mbbsd/assess.c | 22 | ||||
-rw-r--r-- | pttbbs/mbbsd/bbs.c | 3 |
2 files changed, 15 insertions, 10 deletions
diff --git a/pttbbs/mbbsd/assess.c b/pttbbs/mbbsd/assess.c index caa84b3d..36cdc167 100644 --- a/pttbbs/mbbsd/assess.c +++ b/pttbbs/mbbsd/assess.c @@ -45,6 +45,7 @@ int assign_badpost(const char *userid, fileheader_t *fhdr, const char *newpath, const char *comment) { char genbuf[STRLEN]; + char reason[STRLEN]; char rptpath[PATHLEN]; int i, tusernum = searchuser(userid, NULL); @@ -69,14 +70,10 @@ int assign_badpost(const char *userid, fileheader_t *fhdr, break; } while (1); - if (i < (int)DIM(badpost_reason)) - sprintf(genbuf,"劣%s文退回(%s)", comment ? "推" : "", badpost_reason[i]); - else if(i==DIM(badpost_reason)) - { - char *s = genbuf; - strcpy(genbuf, comment ? "劣推文退回(" : "劣文退回("); - s += strlen(genbuf); - while (!getdata_buf(b_lines, 0, "請輸入原因", s, 50, DOECHO)) { + if (i < (int)DIM(badpost_reason)) { + snprintf(reason, sizeof(reason), "%s", badpost_reason[i]); + } else if (i == DIM(badpost_reason)) { + while (!getdata(b_lines, 0, "請輸入原因", reason, 50, DOECHO)) { // 對於 comment 目前可以重來,但非comment 文直接刪掉所以沒法 cancel if (comment) { vmsg("取消設定劣文。"); @@ -85,10 +82,11 @@ int assign_badpost(const char *userid, fileheader_t *fhdr, bell(); continue; } - strcat(genbuf,")"); } - assert(i >= 0 && i <= (int)DIM(badpost_reason)); + + sprintf(genbuf,"劣%s文退回(%s)", comment ? "推" : "", reason); + if (fhdr) strncat(genbuf, fhdr->title, 64-strlen(genbuf)); #ifdef USE_COOLDOWN @@ -111,6 +109,10 @@ int assign_badpost(const char *userid, fileheader_t *fhdr, passwd_sync_update(tusernum, &xuser); } + if (!comment) { + log_filef(newpath, LOG_CREAT, "※ BadPost Reason: %s\n", reason); + } + #ifdef BAD_POST_RECORD // we also change rptpath because such record contains more information { diff --git a/pttbbs/mbbsd/bbs.c b/pttbbs/mbbsd/bbs.c index c03ab0b1..7cea5953 100644 --- a/pttbbs/mbbsd/bbs.c +++ b/pttbbs/mbbsd/bbs.c @@ -3552,6 +3552,9 @@ del_post(int ent, fileheader_t * fhdr, char *direct) } } #endif // ASSESS + if (*newpath && *reason) { + log_filef(newpath, LOG_CREAT, "※ Delete Reason: %s\n", reason); + } if (del_fee <= 0) { |