From f8af0fe1f0f0b5b07d5cb8124765f78e19ce90d6 Mon Sep 17 00:00:00 2001 From: ptt Date: Tue, 28 Oct 2003 17:20:56 +0000 Subject: git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1272 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/bbs.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'mbbsd') diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index 3fa2a048..f599e735 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -338,20 +338,20 @@ outgo_post(fileheader_t * fh, char *board) } static void -cancelpost(fileheader_t * fh, int by_BM) +cancelpost(fileheader_t * fh, int by_BM, char *newpath) { FILE *fin, *fout; char *ptr, *brd; fileheader_t postfile; char genbuf[200]; - char nick[STRLEN], fn1[STRLEN], fn2[STRLEN]; + char nick[STRLEN], fn1[STRLEN]; setbfile(fn1, currboard, fh->filename); if ((fin = fopen(fn1, "r"))) { brd = by_BM ? "deleted" : "junk"; - setbpath(fn2, brd); - stampfile(fn2, &postfile); + setbpath(newpath, brd); + stampfile(newpath, &postfile); memcpy(postfile.owner, fh->owner, IDLEN + TTLEN + 10); nick[0] = '\0'; @@ -372,7 +372,7 @@ cancelpost(fileheader_t * fh, int by_BM) fclose(fout); } fclose(fin); - Rename(fn1, fn2); + Rename(fn1, newpath); setbdir(genbuf, brd); setbtotal(getbnum(brd)); append_record(genbuf, &postfile, sizeof(postfile)); @@ -1708,7 +1708,7 @@ del_range(int ent, fileheader_t * fhdr, char *direct) static int del_post(int ent, fileheader_t * fhdr, char *direct) { - char genbuf[100]; + char genbuf[100], newpath[256]; int not_owned; boardheader_t *bp; @@ -1747,15 +1747,20 @@ del_post(int ent, fileheader_t * fhdr, char *direct) fhdr->money = hdr.money; delete_file(genbuf, sizeof(fileheader_t), num, cmpfilename); } + + cancelpost(fhdr, not_owned, newpath); #ifdef ASSESS if (not_owned) { getdata(1, 40, "´c¦H¤å³¹?(y/N)", genbuf, 3, LCECHO); if(genbuf[0]=='y') + { inc_badpost(searchuser(fhdr->owner), 1); + sprintf(genbuf,"¦H¤å°h¦^:%40.40s", fhdr->title); + mail_id(fhdr->owner, genbuf, newpath, cuser.userid); + } } #endif - cancelpost(fhdr, not_owned); setbtotal(currbid); if (fhdr->money < 0) -- cgit v1.2.3