summaryrefslogtreecommitdiffstats
path: root/mbbsd/bbs.c
diff options
context:
space:
mode:
authorscw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-11-16 18:20:15 +0800
committerscw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-11-16 18:20:15 +0800
commit97b26dd92cdd0f51051dd2762c2584db77273191 (patch)
tree77ca0241d8c3adcc5aeba43582f1696cbeafb289 /mbbsd/bbs.c
parente04cae0836e65a13d3ea8166df4b291aafaa4f53 (diff)
downloadpttbbs-97b26dd92cdd0f51051dd2762c2584db77273191.tar
pttbbs-97b26dd92cdd0f51051dd2762c2584db77273191.tar.gz
pttbbs-97b26dd92cdd0f51051dd2762c2584db77273191.tar.bz2
pttbbs-97b26dd92cdd0f51051dd2762c2584db77273191.tar.lz
pttbbs-97b26dd92cdd0f51051dd2762c2584db77273191.tar.xz
pttbbs-97b26dd92cdd0f51051dd2762c2584db77273191.tar.zst
pttbbs-97b26dd92cdd0f51051dd2762c2584db77273191.zip
Post and money update:
* no money for posts on boards without BM * BM and self deleting posts decrease number of posts regardless of login git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4420 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/bbs.c')
-rw-r--r--mbbsd/bbs.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 344c534f..3831ec12 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -1108,8 +1108,9 @@ do_general(int isbid)
#endif
aborted /= 2;
- // drop money for free boards
- if (IsFreeBoardName(currboard) || (currbrdattr&BRD_BAD))
+ // drop money & numposts for free boards
+ // including: special boards (e.g. TEST, ALLPOST), bad boards, no BM boards
+ if (IsFreeBoardName(currboard) || (currbrdattr&BRD_BAD) || bp->BM[0] < ' ')
{
aborted = 0;
}
@@ -3330,8 +3331,15 @@ del_post(int ent, fileheader_t * fhdr, char *direct)
// not owner case
if (tusernum)
{
+ userec_t xuser;
+ passwd_query(tusernum, &xuser);
+ xuser.numposts--;
+ passwd_update(tusernum, &xuser);
+ sendalert_uid(tusernum, ALERT_PWD_POSTS);
+
// TODO alert user?
deumoney(tusernum, -fhdr->multi.money);
+
#ifdef USE_COOLDOWN
if (bp->brdattr & BRD_COOLDOWN)
add_cooldowntime(tusernum, 15);
@@ -3341,8 +3349,10 @@ del_post(int ent, fileheader_t * fhdr, char *direct)
else
{
// owner case
- if (cuser.numposts)
+ if (cuser.numposts){
cuser.numposts--;
+ sendalert(cuser.userid, ALERT_PWD_POSTS);
+ }
demoney(-fhdr->multi.money);
vmsgf("您的文章減為 %d 篇,支付清潔費 %d 銀",
cuser.numposts, fhdr->multi.money);