diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2010-10-31 01:03:20 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2010-10-31 01:03:20 +0800 |
commit | 4722b6345107b12c6208736777d1cffb6021842d (patch) | |
tree | 57b52ed9ce3c372fb9132942664312aa8d2d50e9 | |
parent | 8cc39254b211d83f8359e773749a7f45d1ab31ae (diff) | |
download | pttbbs-4722b6345107b12c6208736777d1cffb6021842d.tar pttbbs-4722b6345107b12c6208736777d1cffb6021842d.tar.gz pttbbs-4722b6345107b12c6208736777d1cffb6021842d.tar.bz2 pttbbs-4722b6345107b12c6208736777d1cffb6021842d.tar.lz pttbbs-4722b6345107b12c6208736777d1cffb6021842d.tar.xz pttbbs-4722b6345107b12c6208736777d1cffb6021842d.tar.zst pttbbs-4722b6345107b12c6208736777d1cffb6021842d.zip |
check the files recovered from recycle bin
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5188 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/include/config.h | 4 | ||||
-rw-r--r-- | pttbbs/mbbsd/bbs.c | 8 | ||||
-rw-r--r-- | pttbbs/mbbsd/mail.c | 3 | ||||
-rw-r--r-- | pttbbs/mbbsd/psb.c | 2 |
4 files changed, 12 insertions, 5 deletions
diff --git a/pttbbs/include/config.h b/pttbbs/include/config.h index b74f6e2a..f5da026f 100644 --- a/pttbbs/include/config.h +++ b/pttbbs/include/config.h @@ -115,6 +115,10 @@ #define RECYCLE_BIN_NAME "資源回收筒" // "垃圾桶" #endif +#ifndef RECYCLE_BIN_OWNER +#define RECYCLE_BIN_OWNER "[" RECYCLE_BIN_NAME "]" +#endif + #ifndef TIME_CAPSULE_NAME #define TIME_CAPSULE_NAME "Magical Index" // "Time Capsule" #endif diff --git a/pttbbs/mbbsd/bbs.c b/pttbbs/mbbsd/bbs.c index 083ba4e9..c6dddebc 100644 --- a/pttbbs/mbbsd/bbs.c +++ b/pttbbs/mbbsd/bbs.c @@ -840,9 +840,11 @@ cancelpost2(const fileheader_t *fh, char *newpath, size_t sznewpath) { log_filef(fpath, LOG_CREAT, "\n※ Deleted by: %s (%s) %s", cuser.userid, fromhost, Cdatelite(&now)); - if (!timecapsule_archive_new_revision( - fpath, fh, sizeof(*fh), newpath, sznewpath)) - ret = -1; + if (strncmp(fh->owner, RECYCLE_BIN_OWNER, strlen(RECYCLE_BIN_OWNER)) != 0) { + if (!timecapsule_archive_new_revision( + fpath, fh, sizeof(*fh), newpath, sznewpath)) + ret = -1; + } // the file should be already in time capsule if (unlink(fpath) != 0) diff --git a/pttbbs/mbbsd/mail.c b/pttbbs/mbbsd/mail.c index 7c3acc54..5bb86de0 100644 --- a/pttbbs/mbbsd/mail.c +++ b/pttbbs/mbbsd/mail.c @@ -1233,7 +1233,8 @@ mail_del(int ent, const fileheader_t * fhdr, const char *direct) setdirpath(genbuf, direct, fhdr->filename); #ifdef USE_TIME_CAPSULE // bypass those recovered files - if (strcmp(fhdr->owner, "[" RECYCLE_BIN_NAME "]") != 0) + if (strncmp(fhdr->owner, RECYCLE_BIN_OWNER, + strlen(RECYCLE_BIN_OWNER)) != 0) timecapsule_archive_new_revision( genbuf, fhdr, sizeof(*fhdr), NULL, 0); #endif // USE_TIME_CAPSULE diff --git a/pttbbs/mbbsd/psb.c b/pttbbs/mbbsd/psb.c index ccd2b9aa..e948f18d 100644 --- a/pttbbs/mbbsd/psb.c +++ b/pttbbs/mbbsd/psb.c @@ -441,7 +441,7 @@ pvrb_input_processor(int key, int curr, int total, int rows, void *ctx) { ans, sizeof(ans), LCECHO); if (*ans == 'y') { if (mail_log2id(cuser.userid, fh->title, - revfname, "[" RECYCLE_BIN_NAME "]", + revfname, RECYCLE_BIN_OWNER, 1, 0) == 0) { cx->modify_mailbox = 1; vmsg("儲存完成,請至信箱檢查備忘錄信件"); |