summaryrefslogtreecommitdiffstats
path: root/mbbsd/bbs.c
diff options
context:
space:
mode:
authorscw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-12-24 20:28:54 +0800
committerscw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-12-24 20:28:54 +0800
commit7234a7e820487eff9f2abf562ff7cacbc6bd31a2 (patch)
tree9e1548cd0c48a7f185cd41870f55466038c5109e /mbbsd/bbs.c
parent36b8776e3788b80fa07f4e43288bc60ab1d69b13 (diff)
downloadpttbbs-7234a7e820487eff9f2abf562ff7cacbc6bd31a2.tar
pttbbs-7234a7e820487eff9f2abf562ff7cacbc6bd31a2.tar.gz
pttbbs-7234a7e820487eff9f2abf562ff7cacbc6bd31a2.tar.bz2
pttbbs-7234a7e820487eff9f2abf562ff7cacbc6bd31a2.tar.lz
pttbbs-7234a7e820487eff9f2abf562ff7cacbc6bd31a2.tar.xz
pttbbs-7234a7e820487eff9f2abf562ff7cacbc6bd31a2.tar.zst
pttbbs-7234a7e820487eff9f2abf562ff7cacbc6bd31a2.zip
Fix money bug when deleting anonymous post. (Found since some user found
that their money vanished when their article is deleted as badpost) Add some comment. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1429 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/bbs.c')
-rw-r--r--mbbsd/bbs.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 6ce918c7..a50a69f3 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -1855,6 +1855,8 @@ del_post(int ent, fileheader_t * fhdr, char *direct)
/* rocker.011018: 利用reference減低loading */
fileheader_t hdr;
+ /* fhdr->money is not real money now, it's a reference instead.
+ * see select_read() in read.c */
num = fhdr->money & ~FHR_REFERENCE;
setbdir(genbuf, currboard);
get_record(genbuf, &hdr, sizeof(hdr), num);
@@ -1871,6 +1873,8 @@ del_post(int ent, fileheader_t * fhdr, char *direct)
cancelpost(fhdr, not_owned, newpath);
if(fhdr->filemode & FILE_ANONYMOUS)
+ /* When the file is anonymous posted, fhdr->money is author.
+ * see do_general() */
num = fhdr->money;
else
num = searchuser(fhdr->owner);
@@ -1891,7 +1895,7 @@ del_post(int ent, fileheader_t * fhdr, char *direct)
#endif
setbtotal(currbid);
- if (fhdr->money < 0)
+ if (fhdr->money < 0 || fhdr->filemode & FILE_ANONYMOUS)
fhdr->money = 0;
if (not_owned && strcmp(currboard, "Test")) {
deumoney(num, -fhdr->money);
@@ -1927,10 +1931,12 @@ view_postmoney(int ent, fileheader_t * fhdr, char *direct)
}
clrtoeol();
if(fhdr->filemode & FILE_ANONYMOUS)
- prints("匿名管理編號: %d (同一人被查詢時編號相同, 此編號每人看到不相同)",
- fhdr->money + currutmp->pid);
+ /* When the file is anonymous posted, fhdr->money is author.
+ * see do_general() */
+ prints("匿名管理編號: %d (同一人被查詢時編號相同, 此編號每人看到不相同)",
+ fhdr->money + currutmp->pid);
else
- prints("這一篇文章值 %d 銀", fhdr->money);
+ prints("這一篇文章值 %d 銀", fhdr->money);
refresh();
pressanykey();
return FULLUPDATE;