summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorwens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2006-07-25 23:56:32 +0800
committerwens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2006-07-25 23:56:32 +0800
commit2e71f47f81c536b56a2104c30e6e8e5653f2dbf1 (patch)
treeb6d67c40aac520f23eee5761e892fa5daeddf399 /mbbsd
parente8b7db8875e3cba60b0ec8742b0cb7cc63c0bbde (diff)
downloadpttbbs-2e71f47f81c536b56a2104c30e6e8e5653f2dbf1.tar
pttbbs-2e71f47f81c536b56a2104c30e6e8e5653f2dbf1.tar.gz
pttbbs-2e71f47f81c536b56a2104c30e6e8e5653f2dbf1.tar.bz2
pttbbs-2e71f47f81c536b56a2104c30e6e8e5653f2dbf1.tar.lz
pttbbs-2e71f47f81c536b56a2104c30e6e8e5653f2dbf1.tar.xz
pttbbs-2e71f47f81c536b56a2104c30e6e8e5653f2dbf1.tar.zst
pttbbs-2e71f47f81c536b56a2104c30e6e8e5653f2dbf1.zip
change how badpost limit is counted, so default value of 0 will work
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3387 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/bbs.c18
-rw-r--r--mbbsd/mail.c2
-rw-r--r--mbbsd/voteboard.c4
3 files changed, 12 insertions, 12 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 6f8ecbe4..3dc2c3b8 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -698,7 +698,7 @@ do_general(int isbid)
#ifndef DEBUG
if ( !((currmode & MODE_BOARD) || HasUserPerm(PERM_SYSOP)) &&
(cuser.firstlogin > (now - (time4_t)bcache[currbid - 1].post_limit_regtime * 2592000) ||
- cuser.badpost > ((unsigned int)(bcache[currbid - 1].post_limit_badpost)) ||
+ cuser.badpost > (255 - (unsigned int)(bcache[currbid - 1].post_limit_badpost)) ||
cuser.numlogins < ((unsigned int)(bcache[currbid - 1].post_limit_logins) * 10) ||
cuser.numposts < ((unsigned int)(bcache[currbid - 1].post_limit_posts) * 10)) ) {
move(5, 10);
@@ -986,7 +986,7 @@ do_generalboardreply(/*const*/ fileheader_t * fhdr)
assert(0<=currbid-1 && currbid-1<MAX_BOARD);
if ( !((currmode & MODE_BOARD) || HasUserPerm(PERM_SYSOP)) &&
(cuser.firstlogin > (now - (time4_t)bcache[currbid - 1].post_limit_regtime * 2592000) ||
- cuser.badpost > ((unsigned int)(bcache[currbid - 1].post_limit_badpost)) ||
+ cuser.badpost > (255 - (unsigned int)(bcache[currbid - 1].post_limit_badpost)) ||
cuser.numlogins < ((unsigned int)(bcache[currbid - 1].post_limit_logins) * 10) ||
cuser.numposts < ((unsigned int)(bcache[currbid - 1].post_limit_posts) * 10)) ) {
getdata(b_lines - 1, 0, "▲ 回應至 (M)作者信箱 (Q)取消?[M] ",
@@ -1347,7 +1347,7 @@ cross_post(int ent, fileheader_t * fhdr, const char *direct)
if ( !((currmode & MODE_BOARD) || HasUserPerm(PERM_SYSOP)) &&
(cuser.firstlogin > (now - (time4_t)bcache[author - 1].post_limit_regtime * 2592000) ||
- cuser.badpost > ((unsigned int)(bcache[currbid - 1].post_limit_badpost)) ||
+ cuser.badpost > (255 - (unsigned int)(bcache[currbid - 1].post_limit_badpost)) ||
cuser.numlogins < ((unsigned int)(bcache[author - 1].post_limit_logins) * 10) ||
cuser.numposts < ((unsigned int)(bcache[author - 1].post_limit_posts) * 10)) ) {
vmsg("你不夠資深喔!");
@@ -1595,12 +1595,12 @@ do_limitedit(int ent, fileheader_t * fhdr, const char *direct)
} while (temp < 0 || temp > 2550);
bp->post_limit_posts = (unsigned char)(temp / 10);
- sprintf(genbuf, "%u", bp->post_limit_badpost);
+ sprintf(genbuf, "%u", 255 - bp->post_limit_badpost);
do {
getdata_buf(b_lines - 1, 0, "劣文篇數上限 (0~255):", genbuf, 5, LCECHO);
temp = atoi(genbuf);
} while (temp < 0 || temp > 255);
- bp->post_limit_badpost = (unsigned char)temp;
+ bp->post_limit_badpost = (unsigned char)(255 - temp);
assert(0<=currbid-1 && currbid-1<MAX_BOARD);
substitute_record(fn_board, bp, sizeof(boardheader_t), currbid);
@@ -1630,12 +1630,12 @@ do_limitedit(int ent, fileheader_t * fhdr, const char *direct)
} while (temp < 0 || temp > 2550);
bp->vote_limit_posts = (unsigned char)(temp / 10);
- sprintf(genbuf, "%u", bp->vote_limit_badpost);
+ sprintf(genbuf, "%u", 255 - bp->vote_limit_badpost);
do {
getdata_buf(b_lines - 1, 0, "劣文篇數上限 (0~255):", genbuf, 5, LCECHO);
temp = atoi(genbuf);
} while (temp < 0 || temp > 255);
- bp->vote_limit_badpost = (unsigned char)temp;
+ bp->vote_limit_badpost = (unsigned char)(255 - temp);
assert(0<=currbid-1 && currbid-1<MAX_BOARD);
substitute_record(fn_board, bp, sizeof(boardheader_t), currbid);
@@ -2208,7 +2208,7 @@ recommend(int ent, fileheader_t * fhdr, const char *direct)
#ifndef DEBUG
if ( !((currmode & MODE_BOARD) || HasUserPerm(PERM_SYSOP)) &&
(cuser.firstlogin > (now - (time4_t)bcache[currbid - 1].post_limit_regtime * 2592000) ||
- cuser.badpost > ((unsigned int)(bcache[currbid - 1].post_limit_badpost)) ||
+ cuser.badpost > (255 - (unsigned int)(bcache[currbid - 1].post_limit_badpost)) ||
cuser.numlogins < ((unsigned int)(bcache[currbid - 1].post_limit_logins) * 10) ||
cuser.numposts < ((unsigned int)(bcache[currbid - 1].post_limit_posts) * 10)) ) {
move(5, 10);
@@ -3110,7 +3110,7 @@ b_config(void)
move(b_lines - 7, 58);
prints("註冊時間 %d 個月以上", (int)bp->post_limit_regtime);
move(b_lines - 6, 58);
- prints("劣文篇數 %d 篇以下", (int)bp->post_limit_badpost);
+ prints("劣文篇數 %d 篇以下", 255 - (int)bp->post_limit_badpost);
move(b_lines, 0);
if (!((currmode & MODE_BOARD) || HasUserPerm(PERM_SYSOP)))
diff --git a/mbbsd/mail.c b/mbbsd/mail.c
index 1fca15ee..16df6882 100644
--- a/mbbsd/mail.c
+++ b/mbbsd/mail.c
@@ -1291,7 +1291,7 @@ mail_cross_post(int ent, fileheader_t * fhdr, const char *direct)
assert(0<=ent-1 && ent-1<MAX_BOARD);
if ( !(HasUserPerm(PERM_SYSOP)) &&
(cuser.firstlogin > (now - (time4_t)bcache[ent - 1].post_limit_regtime * 2592000) ||
- cuser.badpost > ((unsigned int)(bcache[ent - 1].post_limit_badpost)) ||
+ cuser.badpost > (255 - (unsigned int)(bcache[ent - 1].post_limit_badpost)) ||
cuser.numlogins < ((unsigned int)(bcache[ent - 1].post_limit_logins) * 10) ||
cuser.numposts < ((unsigned int)(bcache[ent - 1].post_limit_posts) * 10)) ) {
move(5, 10);
diff --git a/mbbsd/voteboard.c b/mbbsd/voteboard.c
index 6a79a46a..3578317a 100644
--- a/mbbsd/voteboard.c
+++ b/mbbsd/voteboard.c
@@ -25,7 +25,7 @@ do_voteboardreply(const fileheader_t * fhdr)
return;
}
if (cuser.firstlogin > (now - (time4_t)fhdr->multi.vote_limits.regtime * 2592000) ||
- cuser.badpost > ((unsigned int)(fhdr->multi.vote_limits.badpost)) ||
+ cuser.badpost > (255 - (unsigned int)(fhdr->multi.vote_limits.badpost)) ||
cuser.numlogins < ((unsigned int)(fhdr->multi.vote_limits.logins) * 10) ||
cuser.numposts < ((unsigned int)(fhdr->multi.vote_limits.posts) * 10) ) {
move(5, 10);
@@ -168,7 +168,7 @@ do_voteboard(int type)
return FULLUPDATE;
}
if ( cuser.firstlogin > (now - (time4_t)bcache[currbid - 1].vote_limit_regtime * 2592000) ||
- cuser.badpost > ((unsigned int)(bcache[currbid - 1].vote_limit_badpost)) ||
+ cuser.badpost > (255 - (unsigned int)(bcache[currbid - 1].vote_limit_badpost)) ||
cuser.numlogins < ((unsigned int)(bcache[currbid - 1].vote_limit_logins) * 10) ||
cuser.numposts < ((unsigned int)(bcache[currbid - 1].vote_limit_posts) * 10) ) {
move(5, 10);