summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mbbsd/assess.c13
-rw-r--r--mbbsd/bbs.c11
2 files changed, 11 insertions, 13 deletions
diff --git a/mbbsd/assess.c b/mbbsd/assess.c
index 6797f64d..dcae8c4e 100644
--- a/mbbsd/assess.c
+++ b/mbbsd/assess.c
@@ -5,7 +5,7 @@
/* do (*num) + n, n is integer. */
inline static void inc(unsigned char *num, int n)
{
- if (n >= 0 && SALE_MAXVALUE - *num < n)
+ if (n >= 0 && SALE_MAXVALUE - *num <= n)
(*num) = SALE_MAXVALUE;
else if (n < 0 && *num < -n)
(*num) = 0;
@@ -24,12 +24,11 @@ void inc_badpost(int uid, int num)
{
passwd_query(uid, &xuser);
inc(&xuser.badpost, num);
- if(!(xuser.badpost % 10))
- {
- post_violatelaw(xuser.userid, "Ptt 系統警察", "劣文累計十篇", "罰單一張");
- mail_violatelaw(xuser.userid, "Ptt 系統警察", "劣文累計十篇", "罰單一張");
- xuser.userlevel |= PERM_VIOLATELAW;
- }
+ if (!(xuser.badpost % 10)) {
+ post_violatelaw(xuser.userid, "Ptt 系統警察", "劣文累計十篇", "罰單一張");
+ mail_violatelaw(xuser.userid, "Ptt 系統警察", "劣文累計十篇", "罰單一張");
+ xuser.userlevel |= PERM_VIOLATELAW;
+ }
passwd_update(uid, &xuser);
}
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index f599e735..6ebbe75c 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -1613,11 +1613,10 @@ mark_post(int ent, fileheader_t * fhdr, char *direct)
#ifdef ASSESS
if (!(fhdr->filemode & FILE_BID)){
- if (fhdr->filemode & FILE_MARKED)
- {
- if(!(currbrdattr&BRD_BAD))
- inc_goodpost(searchuser(fhdr->owner), fhdr->recommend / 10);
- }
+ if (fhdr->filemode & FILE_MARKED) {
+ if(!(currbrdattr&BRD_BAD))
+ inc_goodpost(searchuser(fhdr->owner), fhdr->recommend / 10);
+ }
else
inc_goodpost(searchuser(fhdr->owner), -1 * (fhdr->recommend / 10));
}
@@ -1750,7 +1749,7 @@ del_post(int ent, fileheader_t * fhdr, char *direct)
cancelpost(fhdr, not_owned, newpath);
#ifdef ASSESS
- if (not_owned)
+ if (not_owned && currmode & MODE_DIGEST && is_BM(cuser.userid))
{
getdata(1, 40, "惡劣文章?(y/N)", genbuf, 3, LCECHO);
if(genbuf[0]=='y')