summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-01-25 00:06:23 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-01-25 00:06:23 +0800
commit85eafdb25f2f71498f4ad7c23d51cc97ba989f94 (patch)
treeccff9e744833f2a75afc1c957650eba40f246565 /mbbsd
parent9311c722cf1c1e4b150c2f5917ec9704d949df98 (diff)
downloadpttbbs-85eafdb25f2f71498f4ad7c23d51cc97ba989f94.tar
pttbbs-85eafdb25f2f71498f4ad7c23d51cc97ba989f94.tar.gz
pttbbs-85eafdb25f2f71498f4ad7c23d51cc97ba989f94.tar.bz2
pttbbs-85eafdb25f2f71498f4ad7c23d51cc97ba989f94.tar.lz
pttbbs-85eafdb25f2f71498f4ad7c23d51cc97ba989f94.tar.xz
pttbbs-85eafdb25f2f71498f4ad7c23d51cc97ba989f94.tar.zst
pttbbs-85eafdb25f2f71498f4ad7c23d51cc97ba989f94.zip
- edit: fixed currbid=0 assert for anti-crosspost check over non-posts.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3862 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/edit.c47
1 files changed, 28 insertions, 19 deletions
diff --git a/mbbsd/edit.c b/mbbsd/edit.c
index d4fa650f..fad822d5 100644
--- a/mbbsd/edit.c
+++ b/mbbsd/edit.c
@@ -1759,6 +1759,7 @@ write_file(char *fpath, int saveheader, int *islocal, char *mytitle, int upload)
trim(msg);
line++;
+
/* check crosspost */
if (currstat == POSTING && po ) {
int msgsum = StringHash(msg);
@@ -1785,7 +1786,10 @@ write_file(char *fpath, int saveheader, int *islocal, char *mytitle, int upload)
}
curr_buf->currline = NULL;
- if (postrecord.times > MAX_CROSSNUM-1 && !is_hidden_board_friend(currbid, currutmp->uid))
+ // what if currbid == 0? add currstat checking.
+ if (currstat == POSTING &&
+ postrecord.times > MAX_CROSSNUM-1 &&
+ !is_hidden_board_friend(currbid, currutmp->uid))
anticrosspost();
if (po && sum == 3) {
@@ -1793,33 +1797,38 @@ write_file(char *fpath, int saveheader, int *islocal, char *mytitle, int upload)
if(postrecord.last_bid != currbid)
postrecord.times = 0;
}
- if (!aborted) {
- if (islocal)
- *islocal = local_article;
- if (curr_buf->sitesig_string)
- {
- fprintf(fp, curr_buf->sitesig_string);
- }
+ if (aborted)
+ return aborted;
- if (currstat == POSTING || currstat == SMAIL)
- {
- addsignature(fp, curr_buf->ifuseanony);
- }
- else if (currstat == REEDIT
+ if (islocal)
+ *islocal = local_article;
+
+ if (curr_buf->sitesig_string)
+ fprintf(fp, curr_buf->sitesig_string);
+
+ if (currstat == POSTING || currstat == SMAIL)
+ {
+ addsignature(fp, curr_buf->ifuseanony);
+ }
+ else if (currstat == REEDIT)
+ {
#ifndef ALL_REEDIT_LOG
- && strcmp(currboard, GLOBAL_SYSOP) == 0
+ // why force signature in SYSOP board?
+ if(strcmp(currboard, GLOBAL_SYSOP) == 0)
#endif
- ) {
+ {
ptime = localtime4(&now);
fprintf(fp,
"¡° ½s¿è: %-15s ¨Ó¦Û: %-20s (%02d/%02d %02d:%02d)\n",
cuser.userid, fromhost,
- ptime->tm_mon + 1, ptime->tm_mday, ptime->tm_hour, ptime->tm_min);
+ ptime->tm_mon + 1, ptime->tm_mday,
+ ptime->tm_hour, ptime->tm_min);
}
- fclose(fp);
}
- return aborted;
+
+ fclose(fp);
+ return 0;
}
static inline int
@@ -2096,7 +2105,7 @@ static const char *luaBit[] = {
};
static const char *luaStore[] = {
- "USER", "GLOBAL", "limit", "load", "save",
+ "USER", "GLOBAL", "iolimit", "limit", "load", "save",
NULL
};