diff options
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/admin.c | 4 | ||||
-rw-r--r-- | mbbsd/announce.c | 3 | ||||
-rw-r--r-- | mbbsd/bbs.c | 23 | ||||
-rw-r--r-- | mbbsd/cal.c | 3 | ||||
-rw-r--r-- | mbbsd/chat.c | 5 | ||||
-rw-r--r-- | mbbsd/gomo.c | 5 | ||||
-rw-r--r-- | mbbsd/lovepaper.c | 3 | ||||
-rw-r--r-- | mbbsd/mail.c | 18 | ||||
-rw-r--r-- | mbbsd/page.c | 3 | ||||
-rw-r--r-- | mbbsd/talk.c | 8 | ||||
-rw-r--r-- | mbbsd/voteboard.c | 3 | ||||
-rw-r--r-- | mbbsd/xyz.c | 3 |
12 files changed, 25 insertions, 56 deletions
diff --git a/mbbsd/admin.c b/mbbsd/admin.c index 8397234d..1712d7e4 100644 --- a/mbbsd/admin.c +++ b/mbbsd/admin.c @@ -1,4 +1,4 @@ -/* $Id: admin.c,v 1.14 2002/05/21 05:04:14 lwms Exp $ */ +/* $Id: admin.c,v 1.15 2002/05/25 11:18:11 ptt Exp $ */ #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -880,7 +880,6 @@ int scan_register_form(char *regfile, int automode, int neednum) { stampfile(buf1, &mhdr); strcpy(mhdr.owner, cuser.userid); strncpy(mhdr.title, "[註冊失敗]", TTLEN); - mhdr.savemode = 0; mhdr.filemode = 0; sethomedir(title, muser.userid); if(append_record(title, &mhdr, sizeof(mhdr)) != -1) { @@ -955,7 +954,6 @@ int scan_register_form(char *regfile, int automode, int neednum) { stampfile(xfpath, &xfile); strcpy(xfile.owner, "系統"); strcpy(xfile.title, "[報告] 審核記錄"); - xfile.savemode = 'S'; xptr = fopen(xfpath, "w"); fprintf(xptr, "\n時間:%s %s 審了 %d 份註冊單\n diff --git a/mbbsd/announce.c b/mbbsd/announce.c index 0de45055..a31dc6c2 100644 --- a/mbbsd/announce.c +++ b/mbbsd/announce.c @@ -1,4 +1,4 @@ -/* $Id: announce.c,v 1.8 2002/05/13 03:20:04 ptt Exp $ */ +/* $Id: announce.c,v 1.9 2002/05/25 11:18:11 ptt Exp $ */ #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -1121,7 +1121,6 @@ static void a_delete(menu_t *pm) { stampfile(buf, &backup); strcpy(backup.owner, cuser.userid); strcpy(backup.title,pm->header[pm->now - pm->page].title + 2); - backup.savemode = 'D'; sprintf(cmd, "mv -f %s %s", fpath,buf); system(cmd); diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index bd37b7d7..5e4ebff4 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -1,4 +1,4 @@ -/* $Id: bbs.c,v 1.11 2002/05/24 17:44:39 ptt Exp $ */ +/* $Id: bbs.c,v 1.12 2002/05/25 11:18:11 ptt Exp $ */ #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -34,7 +34,6 @@ static void mail_by_link(char* owner, char* title, char* path) { stampfile(genbuf, &mymail); strcpy(mymail.owner, owner); sprintf(mymail.title, title); - mymail.savemode = 0; unlink(genbuf); Link(path, genbuf); sprintf(genbuf,BBSHOME"/home/%c/%s/.DIR",cuser.userid[0],cuser.userid); @@ -312,9 +311,7 @@ static void cancelpost(fileheader_t *fh, int by_BM) { setbpath(fn2, brd); stampfile(fn2, &postfile); memcpy(postfile.owner, fh->owner, IDLEN + TTLEN + 10); - postfile.savemode = 'D'; - if(fh->savemode == 'S') { nick[0] = '\0'; while(fgets(genbuf, sizeof(genbuf), fin)) { if (!strncmp(genbuf, str_author1, LEN_AUTHOR1) || @@ -332,7 +329,6 @@ static void cancelpost(fileheader_t *fh, int by_BM) { cuser.userid, nick, fh->title); fclose(fout); } - } fclose(fin); Rename(fn1, fn2); @@ -374,7 +370,6 @@ static void do_unanonymous_post(char* fpath) { Link(fpath, genbuf); strcpy(mhdr.owner, cuser.userid); strcpy(mhdr.title, save_title); - mhdr.savemode = 0; mhdr.filemode = 0; setbdir(title, "UnAnonymous"); append_record(title, &mhdr, sizeof(mhdr)); @@ -490,11 +485,8 @@ static int do_general() { postfile.money = aborted; strcpy(postfile.owner, owner); strcpy(postfile.title, save_title); - if(islocal) { /* local save */ - postfile.savemode = 'L'; + if(islocal) /* local save */ postfile.filemode = FILE_LOCAL; - } else - postfile.savemode = 'S'; setbdir(buf, currboard); if(append_record(buf, &postfile, sizeof(postfile)) != -1) { @@ -524,7 +516,7 @@ static int do_general() { } strcpy(postfile.owner, owner); strcpy(postfile.title, save_title); - postfile.savemode = 'L'; + postfile.filemode = FILE_LOCAL; setbdir(genbuf, ALLPOST); if(append_record(genbuf, &postfile, sizeof(postfile)) != -1) { setbtotal(getbnum(ALLPOST)); @@ -566,7 +558,7 @@ static int do_general() { strcpy(postfile.owner, cuser.userid); strcpy(postfile.title, save_title); - postfile.savemode = 'B';/* both-reply flag */ + postfile.filemode = FILE_BOTH;/* both-reply flag */ sethomedir(genbuf, quote_user); if(append_record(genbuf, &postfile, sizeof(postfile)) == -1) msg = err_uid; @@ -611,7 +603,6 @@ static void do_generalboardreply(fileheader_t *fhdr){ default: strcpy(currtitle, fhdr->title); strcpy(quote_user, fhdr->owner); - quote_file[79] = fhdr->savemode; do_post(); } *quote_file = 0; @@ -794,10 +785,8 @@ static int cross_post(int ent, fileheader_t *fhdr, char *direct) { strcpy(xfile.owner, cuser.userid); strcpy(xfile.title, xtitle); if(genbuf[0] == 'l') { - xfile.savemode = 'L'; xfile.filemode = FILE_LOCAL; - } else - xfile.savemode = 'S'; + } setbfile(fname, currboard, fhdr->filename); // if(ent) { @@ -1662,7 +1651,7 @@ static int good_post(int ent, fileheader_t *fhdr, char *direct) { if(dashf(genbuf)) unlink (genbuf); - digest.savemode = digest.filemode = 0; + digest.filemode = 0; sprintf(genbuf2, "%s%s", buf, fhdr->filename); Link(genbuf2, genbuf); strcpy(ptr, fn_mandex); diff --git a/mbbsd/cal.c b/mbbsd/cal.c index aec3320b..5d80bc47 100644 --- a/mbbsd/cal.c +++ b/mbbsd/cal.c @@ -1,4 +1,4 @@ -/* $Id: cal.c,v 1.11 2002/05/13 03:20:04 ptt Exp $ */ +/* $Id: cal.c,v 1.12 2002/05/25 11:18:11 ptt Exp $ */ #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -186,7 +186,6 @@ static int osong(char *defaultid) { strcpy(mail.owner, "點歌機"); sprintf(mail.title, "◇ %s 點給 %s ", (ano[0]=='y')?"匿名者":cuser.userid, destid); - mail.savemode = 0; while(fgets(buf, 200, fp)) { char *po; diff --git a/mbbsd/chat.c b/mbbsd/chat.c index e7e7846a..284403a8 100644 --- a/mbbsd/chat.c +++ b/mbbsd/chat.c @@ -1,4 +1,4 @@ -/* $Id: chat.c,v 1.3 2002/05/13 03:20:04 ptt Exp $ */ +/* $Id: chat.c,v 1.4 2002/05/25 11:18:11 ptt Exp $ */ #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -600,8 +600,7 @@ int t_chat() { sethomepath(genbuf, cuser.userid); stampfile(genbuf, &mymail); - mymail.savemode = 'H'; /* hold-mail flag */ - mymail.filemode = FILE_READ; + mymail.filemode = FILE_READ|FILE_HOLD; strcpy(mymail.owner, "[備.忘.錄]"); strcpy(mymail.title, "會議\033[1;33m記錄\033[m"); sethomedir(title, cuser.userid); diff --git a/mbbsd/gomo.c b/mbbsd/gomo.c index 190d6f71..a8174d7f 100644 --- a/mbbsd/gomo.c +++ b/mbbsd/gomo.c @@ -1,4 +1,4 @@ -/* $Id: gomo.c,v 1.3 2002/05/13 03:20:04 ptt Exp $ */ +/* $Id: gomo.c,v 1.4 2002/05/25 11:18:11 ptt Exp $ */ #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -85,8 +85,7 @@ static void HO_log(char *user) { sethomepath(buf1, cuser.userid); stampfile(buf1, &mymail); - mymail.savemode = 'H'; /* hold-mail flag */ - mymail.filemode = FILE_READ; + mymail.filemode = FILE_READ|FILE_HOLD; strcpy(mymail.owner, "[備.忘.錄]"); sprintf(mymail.title, "\033[37;41m棋譜\033[m %s VS %s", cuser.userid, user); diff --git a/mbbsd/lovepaper.c b/mbbsd/lovepaper.c index dffdee69..f4b8b56c 100644 --- a/mbbsd/lovepaper.c +++ b/mbbsd/lovepaper.c @@ -1,4 +1,4 @@ -/* $Id: lovepaper.c,v 1.3 2002/05/13 03:20:04 ptt Exp $ */ +/* $Id: lovepaper.c,v 1.4 2002/05/25 11:18:11 ptt Exp $ */ #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -109,7 +109,6 @@ int x_love() { Rename(path, buf1); strncpy(mhdr.title, save_title, TTLEN); strcpy(mhdr.owner, cuser.userid); - mhdr.savemode = '\0'; sethomedir(path, receiver ); if(append_record(path, &mhdr, sizeof(mhdr)) == -1) return -1; diff --git a/mbbsd/mail.c b/mbbsd/mail.c index 21871d5c..a67f4002 100644 --- a/mbbsd/mail.c +++ b/mbbsd/mail.c @@ -1,4 +1,4 @@ -/* $Id: mail.c,v 1.8 2002/05/16 21:54:56 in2 Exp $ */ +/* $Id: mail.c,v 1.9 2002/05/25 11:18:11 ptt Exp $ */ #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -127,7 +127,6 @@ int mail_id(char* id, char *title, char *filename, char *owner) { return 0; strcpy(mhdr.owner, owner); strncpy(mhdr.title, title, TTLEN); - mhdr.savemode = 0; mhdr.filemode = 0; Link(filename, genbuf); sethomedir(genbuf,id); @@ -223,8 +222,7 @@ static void do_hold_mail(char *fpath, char *receiver, char *holder) { sethomepath(buf, holder); stampfile(buf, &mymail); - mymail.savemode = 'H'; /* hold-mail flag */ - mymail.filemode = FILE_READ; + mymail.filemode = FILE_READ|FILE_HOLD; strcpy(mymail.owner, "[備.忘.錄]"); if(receiver) { sprintf(title, "(%s) %s", receiver, save_title); @@ -314,7 +312,6 @@ int do_send(char *userid, char *title) { stampfile(genbuf, &mhdr); strcpy(mhdr.owner, cuser.userid); strncpy(mhdr.title, save_title, TTLEN); - mhdr.savemode = '\0'; if(vedit(genbuf, YEA, NULL) == -1) { unlink(genbuf); clear(); @@ -547,7 +544,7 @@ static void multi_send(char *title) { strcpy(mymail.owner, cuser.userid); strcpy(mymail.title, save_title); - mymail.savemode = 'M'; /* multi-send flag */ + mymail.filemode |= FILE_MULTI; /* multi-send flag */ sethomedir(genbuf, p->word); if(append_record(genbuf, &mymail, sizeof(mymail)) == -1) outs(err_uid); @@ -562,7 +559,7 @@ static void multi_send(char *title) { } static int multi_reply(int ent, fileheader_t *fhdr, char *direct) { - if(fhdr->savemode != 'M') + if(!(fhdr->filemode&FILE_MULTI) ) return mail_reply(ent, fhdr, direct); stand_title("群組回信"); @@ -626,7 +623,6 @@ int mail_all() { strcpy(mymail.owner, cuser.userid); /*站長 ID*/ strcpy(mymail.title, save_title); - mymail.savemode = 0; sethomedir(genbuf, cuser.userid); if(append_record(genbuf, &mymail, sizeof(mymail)) == -1) @@ -646,7 +642,6 @@ int mail_all() { strcpy(mymail.owner, cuser.userid); strcpy(mymail.title, save_title); - mymail.savemode = 0; /* mymail.filemode |= FILE_MARKED; Ptt 公告改成不會mark */ sethomedir(genbuf, userid); if(append_record(genbuf, &mymail, sizeof(mymail)) == -1) @@ -1160,10 +1155,8 @@ static int mail_cross_post(int ent, fileheader_t *fhdr, char *direct) { strcpy(xfile.owner, cuser.userid); strcpy(xfile.title, xtitle); if(genbuf[0] == 'l') { - xfile.savemode = 'L'; xfile.filemode = FILE_LOCAL; - } else - xfile.savemode = 'S'; + } setuserfile(fname, fhdr->filename); if(ent) { @@ -1648,7 +1641,6 @@ static void mail_justify(userec_t muser) { unlink(buf1); strcpy(mhdr.owner, cuser.userid); strncpy(mhdr.title, "[審核通過]", TTLEN); - mhdr.savemode = 0; mhdr.filemode = 0; if(valid_ident(muser.email) && !invalidaddr(muser.email)) { diff --git a/mbbsd/page.c b/mbbsd/page.c index 5be7762e..05b2f744 100644 --- a/mbbsd/page.c +++ b/mbbsd/page.c @@ -1,4 +1,4 @@ -/* $Id: page.c,v 1.3 2002/04/28 19:35:29 in2 Exp $ */ +/* $Id: page.c,v 1.4 2002/05/25 11:18:11 ptt Exp $ */ #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -110,7 +110,6 @@ int main_railway() { stampfile(genbuf, &mhdr); strcpy(mhdr.owner, "Ptt搜尋器"); strncpy(mhdr.title, "火車時刻搜尋結果", TTLEN); - mhdr.savemode = '\0'; sprintf(command,"echo \"from-station=%s&to-station=%s" "&from-time=%02d00&to-time=%02d00&tt=%s&type=%s\" | " diff --git a/mbbsd/talk.c b/mbbsd/talk.c index 5d070193..82ffb0ef 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -1,4 +1,4 @@ -/* $Id: talk.c,v 1.46 2002/05/25 06:59:50 in2 Exp $ */ +/* $Id: talk.c,v 1.47 2002/05/25 11:18:11 ptt Exp $ */ #include <stdio.h> #include <string.h> #include <errno.h> @@ -820,8 +820,7 @@ int t_display(void) sethomepath(buf, cuser.userid); stampfile(buf, &mymail); - mymail.savemode = 'H'; /* hold-mail flag */ - mymail.filemode = FILE_READ; + mymail.filemode = FILE_READ | FILE_HOLD; strcpy(mymail.owner, "[備.忘.錄]"); strcpy(mymail.title, "熱線\033[37;41m記錄\033[m"); sethomedir(title, cuser.userid); @@ -1105,8 +1104,7 @@ static void do_talk(int fd) sethomepath(genbuf, cuser.userid); stampfile(genbuf, &mymail); - mymail.savemode = 'H'; /* hold-mail flag */ - mymail.filemode = FILE_READ; + mymail.filemode = FILE_READ|FILE_HOLD; strcpy(mymail.owner, "[備.忘.錄]"); sprintf(mymail.title, "對話記錄 \033[1;36m(%s)\033[m", getuserid(currutmp->destuid)); diff --git a/mbbsd/voteboard.c b/mbbsd/voteboard.c index 8b92adb7..f8be3d27 100644 --- a/mbbsd/voteboard.c +++ b/mbbsd/voteboard.c @@ -1,4 +1,4 @@ -/* $Id: voteboard.c,v 1.5 2002/05/13 03:20:04 ptt Exp $ */ +/* $Id: voteboard.c,v 1.6 2002/05/25 11:18:11 ptt Exp $ */ #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -442,7 +442,6 @@ int do_voteboard() { fclose(fp); strcpy(votefile.owner, cuser.userid); strcpy(votefile.title, title); - votefile.savemode = 'S'; setbdir(genbuf, currboard); if(append_record(genbuf, &votefile, sizeof(votefile)) != -1) setbtotal(currbid); diff --git a/mbbsd/xyz.c b/mbbsd/xyz.c index d880a178..3754582e 100644 --- a/mbbsd/xyz.c +++ b/mbbsd/xyz.c @@ -1,4 +1,4 @@ -/* $Id: xyz.c,v 1.6 2002/05/14 15:08:48 ptt Exp $ */ +/* $Id: xyz.c,v 1.7 2002/05/25 11:18:11 ptt Exp $ */ #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -435,7 +435,6 @@ static int x_archie() { strcpy(mhdr.owner, cuser.userid); sprintf(genbuf2, "Archie 搜尋檔案: %s 結果", genbuf1); strcpy(mhdr.title, genbuf2); - mhdr.savemode = 0; mhdr.filemode = 0; sethomedir(title, cuser.userid); append_record(title, &mhdr, sizeof(mhdr)); |