summaryrefslogtreecommitdiffstats
path: root/mbbsd/mail.c
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-04-30 22:32:22 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-04-30 22:32:22 +0800
commit1b62cf169aa0a0bcfaf0e22d1088fe59e77b93f9 (patch)
tree68d5dc455498705b7b2b6e5915daa5daa1d0eca7 /mbbsd/mail.c
parent413ad044cf6c17af0cc63d5fb80f91b4bfa06713 (diff)
downloadpttbbs-1b62cf169aa0a0bcfaf0e22d1088fe59e77b93f9.tar
pttbbs-1b62cf169aa0a0bcfaf0e22d1088fe59e77b93f9.tar.gz
pttbbs-1b62cf169aa0a0bcfaf0e22d1088fe59e77b93f9.tar.bz2
pttbbs-1b62cf169aa0a0bcfaf0e22d1088fe59e77b93f9.tar.lz
pttbbs-1b62cf169aa0a0bcfaf0e22d1088fe59e77b93f9.tar.xz
pttbbs-1b62cf169aa0a0bcfaf0e22d1088fe59e77b93f9.tar.zst
pttbbs-1b62cf169aa0a0bcfaf0e22d1088fe59e77b93f9.zip
clean up getindex() and substitute record
fix bug of OSONG git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1901 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/mail.c')
-rw-r--r--mbbsd/mail.c44
1 files changed, 10 insertions, 34 deletions
diff --git a/mbbsd/mail.c b/mbbsd/mail.c
index f4a53dfa..731f37cf 100644
--- a/mbbsd/mail.c
+++ b/mbbsd/mail.c
@@ -823,22 +823,19 @@ mail_del(int ent, fileheader_t * fhdr, char *direct)
if (fhdr->filemode & FILE_MARKED)
return DONOTHING;
- getdata(1, 0, msg_del_ny, genbuf, 3, LCECHO);
- if (genbuf[0] == 'y') {
- strlcpy(currfile, fhdr->filename, sizeof(currfile));
+ if (currmode & MODE_SELECT) {
+ vmsg("請先回到正常模式後再進行刪除...");
+ return READ_REDRAW;
+ }
+
+ if (getans(msg_del_ny) == 'y') {
if (!delete_record(direct, sizeof(*fhdr), ent)) {
setdirpath(genbuf, direct, fhdr->filename);
unlink(genbuf);
- if ((currmode & MODE_SELECT)) {
- int index;
- sethomedir(genbuf, cuser.userid);
- index = getindex(genbuf, fhdr->filename);
- delete_record(genbuf, sizeof(fileheader_t), index);
- }
return DIRCHANGED;
}
}
- return TITLE_REDRAW;
+ return READ_REDRAW;
}
static int
@@ -856,14 +853,7 @@ mail_read(int ent, fileheader_t * fhdr, char *direct)
if (more_result != -1) {
fhdr->filemode |= FILE_READ;
- if ((currmode & MODE_SELECT)) {
- int index;
-
- index = getindex(currmaildir, fhdr->filename);
- substitute_record(currmaildir, fhdr, sizeof(*fhdr), index);
- substitute_record(direct, fhdr, sizeof(*fhdr), ent);
- } else
- substitute_record(currmaildir, fhdr, sizeof(*fhdr), ent);
+ substitute_ref_record(direct, fhdr, ent);
}
switch (more_result) {
case 999:
@@ -900,14 +890,7 @@ mail_read(int ent, fileheader_t * fhdr, char *direct)
mail_del(ent, fhdr, direct);
else {
fhdr->filemode |= FILE_READ;
- if ((currmode & MODE_SELECT)) {
- int index;
-
- index = getindex(currmaildir, fhdr->filename);
- substitute_record(currmaildir, fhdr, sizeof(*fhdr), index);
- substitute_record(direct, fhdr, sizeof(*fhdr), ent);
- } else
- substitute_record(currmaildir, fhdr, sizeof(*fhdr), ent);
+ substitute_ref_record(direct, fhdr, ent);
}
return FULLUPDATE;
}
@@ -999,14 +982,7 @@ mail_mark(int ent, fileheader_t * fhdr, char *direct)
{
fhdr->filemode ^= FILE_MARKED;
- if ((currmode & MODE_SELECT)) {
- int index;
-
- index = getindex(currmaildir, fhdr->filename);
- substitute_record(currmaildir, fhdr, sizeof(*fhdr), index);
- substitute_record(direct, fhdr, sizeof(*fhdr), ent);
- } else
- substitute_record(currmaildir, fhdr, sizeof(*fhdr), ent);
+ substitute_ref_record(direct, fhdr, ent);
return PART_REDRAW;
}