diff options
-rw-r--r-- | pttbbs/include/proto.h | 1 | ||||
-rw-r--r-- | pttbbs/mbbsd/syspost.c | 27 |
2 files changed, 20 insertions, 8 deletions
diff --git a/pttbbs/include/proto.h b/pttbbs/include/proto.h index b726da31..6a505563 100644 --- a/pttbbs/include/proto.h +++ b/pttbbs/include/proto.h @@ -646,6 +646,7 @@ int post_msg(const char* bname, const char* title, const char *msg, const char* int post_file(const char *bname, const char *title, const char *filename, const char *author); void post_newboard(const char *bgroup, const char *bname, const char *bms); void post_violatelaw(const char *crime, const char *police, const char *reason, const char *result); +void post_violatelaw2(const char *crime, const char *police, const char *reason, const char *result, const char *memo); void post_change_perm(int oldperm, int newperm, const char *sysopid, const char *userid); void post_policelog(const char *bname, const char *atitle, const char *action, const char *reason, const int toggle); diff --git a/pttbbs/mbbsd/syspost.c b/pttbbs/mbbsd/syspost.c index 181e26fb..140154e8 100644 --- a/pttbbs/mbbsd/syspost.c +++ b/pttbbs/mbbsd/syspost.c @@ -92,28 +92,39 @@ post_change_perm(int oldperm, int newperm, const char *sysopid, const char *user } void -post_violatelaw(const char *crime, const char *police, const char *reason, const char *result) +post_violatelaw(const char *crime, const char *police, const char *reason, const + char *result) { + return post_violatelaw2(crime, police, reason, result, ""); +} + +void +post_violatelaw2(const char *crime, const char *police, const char *reason, const + char *result, const char *memo) { char title[TTLEN+1]; - char msg[ANSILINELEN]; + char msg[ANSILINELEN * 10]; snprintf(title, sizeof(title), "[報告] %s:%-*s 判決", crime, (int)(30 - strlen(crime)), reason); snprintf(msg, sizeof(msg), ANSI_COLOR(1;32) "%s" ANSI_RESET "判決:\n" - " " ANSI_COLOR(1;32) "%s" ANSI_RESET "因" ANSI_COLOR(1;35) "%s" ANSI_RESET "行為,\n" - "違反本站站規,處以" ANSI_COLOR(1;35) "%s" ANSI_RESET ",特此公告\n", - police, crime, reason, result); + " " ANSI_COLOR(1;32) "%s" ANSI_RESET "因" + ANSI_COLOR(1;35) "%s" ANSI_RESET "行為,\n" + "違反本站站規,處以" ANSI_COLOR(1;35) "%s" ANSI_RESET + ",特此公告\n\n\n%s\n", + police, crime, reason, result, memo ? memo : ""); if (!strstr(police, "警察")) { post_msg("PoliceLog", title, msg, "[" BBSMNAME "法院]"); snprintf(msg, sizeof(msg), ANSI_COLOR(1;32) "%s" ANSI_RESET "判決:\n" - " " ANSI_COLOR(1;32) "%s" ANSI_RESET "因" ANSI_COLOR(1;35) "%s" ANSI_RESET "行為,\n" - "違反本站站規,處以" ANSI_COLOR(1;35) "%s" ANSI_RESET ",特此公告\n", - "站務警察", crime, reason, result); + " " ANSI_COLOR(1;32) "%s" ANSI_RESET "因" + ANSI_COLOR(1;35) "%s" ANSI_RESET "行為,\n" + "違反本站站規,處以" ANSI_COLOR(1;35) "%s" ANSI_RESET + ",特此公告\n\n\n%s\n", + "站務警察", crime, reason, result, memo ? memo : ""); } post_msg("ViolateLaw", title, msg, "[" BBSMNAME "法院]"); |