diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-06-27 22:50:15 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-06-27 22:50:15 +0800 |
commit | 982e6238fc69b854749f3f4b693b958048792a33 (patch) | |
tree | bd668284f4c4c832281666e4ffbe4860115bd8ca | |
parent | aa516702616632a2d5a7e634017c3e5845440f6a (diff) | |
download | pttbbs-982e6238fc69b854749f3f4b693b958048792a33.tar pttbbs-982e6238fc69b854749f3f4b693b958048792a33.tar.gz pttbbs-982e6238fc69b854749f3f4b693b958048792a33.tar.bz2 pttbbs-982e6238fc69b854749f3f4b693b958048792a33.tar.lz pttbbs-982e6238fc69b854749f3f4b693b958048792a33.tar.xz pttbbs-982e6238fc69b854749f3f4b693b958048792a33.tar.zst pttbbs-982e6238fc69b854749f3f4b693b958048792a33.zip |
* provide message when file was already removed (which implies no badpost can be assigned)
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4703 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd/bbs.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index 17a4c3ab..019f16bf 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -3213,6 +3213,9 @@ del_post(int ent, fileheader_t * fhdr, char *direct) (bp->nuser > 30 && !(currmode & MODE_DIGEST) && !safe_article_delete(ent, fhdr, direct)) || #endif + // XXX TODO delete_record is really really dangerous - + // we should verify the header (maybe by filename) is the same. + // currently race condition is easily cause by 2 BMs !delete_record(direct, sizeof(fileheader_t), ent) ) { @@ -3221,8 +3224,22 @@ del_post(int ent, fileheader_t * fhdr, char *direct) #ifdef ASSESS #define SIZE sizeof(badpost_reason) / sizeof(char *) - // TODO not_owned 時也要改變 numpost? - if (del_ok && not_owned && tusernum > 0 && !(currmode & MODE_DIGEST)) { + // case one, owned or digest - should not give bad posts + if (!not_owned || tusernum <= 0 || (currmode & MODE_DIGEST) ) + { + // do nothing + } + // case 2, not owned but cannot delete (also skip badpost) + else if (!del_ok) + { + move(1, 40); clrtoeol(); + outs("由於此檔已被別人刪除,禁止再次給予劣文。"); + pressanykey(); + } + // case 3, not owned and deleted, can assign badpost + else + { + // TODO not_owned 時也要改變 numpost? if (now - atoi(fhdr->filename + 2) > 7 * 24 * 60 * 60) /* post older than a week */ genbuf[0] = 'n'; |