summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-10-29 17:28:33 +0800
committervictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-10-29 17:28:33 +0800
commita0fe02551412613cf1937f299f45b189abc96296 (patch)
tree81acdd0f8fde57b19da3cbf883165268f1098ae7
parentc88f909fd3eb9111e3be6f01826c945e3e75d769 (diff)
downloadpttbbs-a0fe02551412613cf1937f299f45b189abc96296.tar
pttbbs-a0fe02551412613cf1937f299f45b189abc96296.tar.gz
pttbbs-a0fe02551412613cf1937f299f45b189abc96296.tar.bz2
pttbbs-a0fe02551412613cf1937f299f45b189abc96296.tar.lz
pttbbs-a0fe02551412613cf1937f299f45b189abc96296.tar.xz
pttbbs-a0fe02551412613cf1937f299f45b189abc96296.tar.zst
pttbbs-a0fe02551412613cf1937f299f45b189abc96296.zip
move violate out to bbs.c
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@1274 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/mbbsd/assess.c17
-rw-r--r--pttbbs/mbbsd/bbs.c17
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);