summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-04-14 22:19:06 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-04-14 22:19:06 +0800
commita9253065d48fb023ce89289b9ee481fa38f55687 (patch)
tree68287501be4afb4ce0df6a74a6fdc40e2fbf1384
parent2eada8f40b4296e612182b55907fecf4dcaaf9fe (diff)
downloadpttbbs-a9253065d48fb023ce89289b9ee481fa38f55687.tar
pttbbs-a9253065d48fb023ce89289b9ee481fa38f55687.tar.gz
pttbbs-a9253065d48fb023ce89289b9ee481fa38f55687.tar.bz2
pttbbs-a9253065d48fb023ce89289b9ee481fa38f55687.tar.lz
pttbbs-a9253065d48fb023ce89289b9ee481fa38f55687.tar.xz
pttbbs-a9253065d48fb023ce89289b9ee481fa38f55687.tar.zst
pttbbs-a9253065d48fb023ce89289b9ee481fa38f55687.zip
delete with threshold
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1760 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/read.c17
-rw-r--r--mbbsd/record.c7
2 files changed, 12 insertions, 12 deletions
diff --git a/mbbsd/read.c b/mbbsd/read.c
index 55a446c8..699d8cec 100644
--- a/mbbsd/read.c
+++ b/mbbsd/read.c
@@ -161,7 +161,7 @@ TagThread(char *direct)
int
TagPruner(int bid)
{
- boardheader_t *bp;
+ boardheader_t *bp=NULL;
assert(bid >= 0); /* bid == 0 means in mailbox */
if (bid){
bp = getbcache(bid);
@@ -169,9 +169,14 @@ TagPruner(int bid)
return DONOTHING;
}
if (TagNum && ((currstat != READING) || (currmode & MODE_BOARD))) {
- if (tolower(getans("刪除所有標記[N]?")) != 'y')
+ if (getans("刪除所有標記[N]?") != 'y')
return READ_REDRAW;
- delete_range(currdirect, 0, 0);
+#ifdef SAFE_ARTICLE_DELETE
+ if(bp && bp->nuser>20)
+ safe_delete_range(currdirect, 0, 0);
+ else
+#endif
+ delete_range(currdirect, 0, 0);
TagNum = 0;
if (bid)
setbtotal(bid);
@@ -899,7 +904,8 @@ i_read(int cmdmode, char *direct, void (*dotitle) (), void (*doentry) (), onekey
if(recbase <= bottom_line)
entries = get_records(currdirect, headers, FHSZ, recbase,
p_lines);
- if( entries>=0 && entries<p_lines && n_bottom)
+ if( !(currmode & (MODE_SELECT | MODE_DIGEST)) &&
+ entries>=0 && entries<p_lines && n_bottom)
entries +=get_records(directbottom,&headers[entries],FHSZ,
recbase<=bottom_line ? 1 : recbase-bottom_line,
p_lines-entries);
@@ -987,7 +993,8 @@ i_read(int cmdmode, char *direct, void (*dotitle) (), void (*doentry) (), onekey
if(recbase <= bottom_line)
entries = get_records(currdirect, headers, FHSZ, recbase,
p_lines);
- if( entries>=0 && entries<p_lines && n_bottom)
+ if( !(currmode & (MODE_SELECT | MODE_DIGEST)) &&
+ entries>=0 && entries<p_lines && n_bottom)
entries +=get_records(directbottom,&headers[entries],FHSZ,
recbase<=bottom_line ? 1 : recbase-bottom_line,
p_lines-entries);
diff --git a/mbbsd/record.c b/mbbsd/record.c
index 28d39195..b11325d0 100644
--- a/mbbsd/record.c
+++ b/mbbsd/record.c
@@ -247,13 +247,6 @@ delete_range(char *fpath, int id1, int id2)
int fdr, fdw, fd;
int count;
-#ifdef SAFE_ARTICLE_DELETE
- if( fpath[0] == 'b' ){
- safe_delete_range(fpath, id1, id2);
- return 0;
- }
-#endif
-
nolfilename(&my, fpath);
if ((fd = open(my.lockfn, O_RDWR | O_CREAT | O_APPEND, 0644)) == -1)