From a4ca9945a1f90b2c65d73ecc454d98028a4ea0d7 Mon Sep 17 00:00:00 2001 From: in2 Date: Fri, 16 Jun 2006 07:26:12 +0000 Subject: 1.remove str_checksum() (use StringHash() now) 2.prevent cross posting from mail git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3371 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/bbs.c | 2 +- mbbsd/edit.c | 2 +- mbbsd/mail.c | 18 ++++++++++++++++++ mbbsd/stuff.c | 11 ----------- 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index 9b0d736c..e31138a5 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -1323,7 +1323,7 @@ cross_post(int ent, fileheader_t * fhdr, const char *direct) } /* 借用變數 */ - ent = str_checksum(fhdr->title); + ent = StringHash(fhdr->title); author = getbnum(xboard); assert(0<=author-1 && author-1title); + /* 同樣 title 不管對哪個板都算 cross post , 所以不用檢查 author */ + + if ((ent != 0 && ent == postrecord.checksum[0])) { + /* 檢查 cross post 次數 */ + if (postrecord.times++ > MAX_CROSSNUM) + anticrosspost(); + } else { + postrecord.times = 0; + postrecord.last_bid = 0; + postrecord.checksum[0] = ent; + } + ent = getbnum(xboard); assert(0<=ent-1 && ent-1