From a0fe02551412613cf1937f299f45b189abc96296 Mon Sep 17 00:00:00 2001 From: victor Date: Wed, 29 Oct 2003 09:28:33 +0000 Subject: move violate out to bbs.c git-svn-id: http://opensvn.csie.org/pttbbs/trunk@1274 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- pttbbs/mbbsd/assess.c | 17 ++++++++--------- pttbbs/mbbsd/bbs.c | 17 ++++++++++------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/pttbbs/mbbsd/assess.c b/pttbbs/mbbsd/assess.c index dcae8c4e..957d3042 100644 --- a/pttbbs/mbbsd/assess.c +++ b/pttbbs/mbbsd/assess.c @@ -13,37 +13,36 @@ inline static void inc(unsigned char *num, int n) (*num) += n; } -void inc_goodpost(int uid, int num) +int inc_goodpost(int uid, int num) { passwd_query(uid, &xuser); inc(&xuser.goodpost, num); passwd_update(uid, &xuser); + return xuser.goodpost; } -void inc_badpost(int uid, int num) +int 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; - } passwd_update(uid, &xuser); + return xuser.badpost; } -void inc_goodsale(int uid, int num) +int inc_goodsale(int uid, int num) { passwd_query(uid, &xuser); inc(&xuser.goodsale, num); passwd_update(uid, &xuser); + return xuser.goodsale; } -void inc_badsale(int uid, int num) +int inc_badsale(int uid, int num) { passwd_query(uid, &xuser); inc(&xuser.badsale, num); passwd_update(uid, &xuser); + return xuser.badsale; } void set_assess(int uid, unsigned char num, int type) diff --git a/pttbbs/mbbsd/bbs.c b/pttbbs/mbbsd/bbs.c index 6ebbe75c..80a012c8 100644 --- a/pttbbs/mbbsd/bbs.c +++ b/pttbbs/mbbsd/bbs.c @@ -1752,13 +1752,16 @@ del_post(int ent, fileheader_t * fhdr, char *direct) if (not_owned && currmode & MODE_DIGEST && is_BM(cuser.userid)) { getdata(1, 40, "惡劣文章?(y/N)", genbuf, 3, LCECHO); - if(genbuf[0]=='y') - { - inc_badpost(searchuser(fhdr->owner), 1); - sprintf(genbuf,"劣文退回:%40.40s", fhdr->title); - mail_id(fhdr->owner, genbuf, newpath, cuser.userid); - } - } + if(genbuf[0]=='y') { + if (!(inc_badpost(searchuser(fhdr->owner), 1) % 10)){ + post_violatelaw(xuser.userid, "Ptt 系統警察", "劣文累計十篇", "罰單一張"); + mail_violatelaw(xuser.userid, "Ptt 系統警察", "劣文累計十篇", "罰單一張"); + xuser.userlevel |= PERM_VIOLATELAW; + } + sprintf(genbuf,"劣文退回:%40.40s", fhdr->title); + mail_id(fhdr->owner, genbuf, newpath, cuser.userid); + } + } #endif setbtotal(currbid); -- cgit v1.2.3