diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-04-10 20:48:40 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-04-10 20:48:40 +0800 |
commit | 90eb3c77f058ddad2e6d369b8aab5232f685c100 (patch) | |
tree | 23b6677da96436058b5f6b538b03ac3bfcc6fd99 | |
parent | e198264c33367686003b30ae2399df6f286978bf (diff) | |
download | pttbbs-90eb3c77f058ddad2e6d369b8aab5232f685c100.tar pttbbs-90eb3c77f058ddad2e6d369b8aab5232f685c100.tar.gz pttbbs-90eb3c77f058ddad2e6d369b8aab5232f685c100.tar.bz2 pttbbs-90eb3c77f058ddad2e6d369b8aab5232f685c100.tar.lz pttbbs-90eb3c77f058ddad2e6d369b8aab5232f685c100.tar.xz pttbbs-90eb3c77f058ddad2e6d369b8aab5232f685c100.tar.zst pttbbs-90eb3c77f058ddad2e6d369b8aab5232f685c100.zip |
- (internal) vedit should not change input parameter.
- (internal) prepare to disable mail auto forwarding
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4127 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | include/proto.h | 4 | ||||
-rw-r--r-- | mbbsd/edit.c | 9 | ||||
-rw-r--r-- | mbbsd/mail.c | 5 | ||||
-rw-r--r-- | mbbsd/menu.c | 5 | ||||
-rw-r--r-- | mbbsd/record.c | 2 | ||||
-rw-r--r-- | mbbsd/register.c | 1 |
6 files changed, 16 insertions, 10 deletions
diff --git a/include/proto.h b/include/proto.h index ade34488..8fdee450 100644 --- a/include/proto.h +++ b/include/proto.h @@ -225,8 +225,8 @@ int main_dark(int fd,userinfo_t *uin); int dice_main(void); /* edit */ -int vedit(char *fpath, int saveheader, int *islocal); -int vedit2(char *fpath, int saveheader, int *islocal, int flags); +int vedit(const char *fpath, int saveheader, int *islocal); +int vedit2(const char *fpath, int saveheader, int *islocal, int flags); void write_header(FILE *fp, char *mytitle); void addsignature(FILE *fp, int ifuseanony); void auto_backup(void); diff --git a/mbbsd/edit.c b/mbbsd/edit.c index 2e3f3985..f49af1e2 100644 --- a/mbbsd/edit.c +++ b/mbbsd/edit.c @@ -1670,7 +1670,7 @@ static void upload_file(void); #endif // EXP_EDIT_UPLOAD static int -write_file(char *fpath, int saveheader, int *islocal, char *mytitle, int upload, int chtitle) +write_file(const char *fpath, int saveheader, int *islocal, char *mytitle, int upload, int chtitle) { struct tm *ptime; FILE *fp = NULL; @@ -1758,8 +1758,7 @@ write_file(char *fpath, int saveheader, int *islocal, char *mytitle, int upload, if (saveheader && !(curredit & EDIT_MAIL) && check_quote()) return KEEP_EDITING; - if (!(*fpath)) - setuserfile(fpath, "ve_XXXXXX"); + assert(*fpath); if ((fp = fopen(fpath, "w")) == NULL) { indigestion(5); abort_bbs(0); @@ -3234,7 +3233,7 @@ upload_file(void) /* 編輯處理:主程式、鍵盤處理 */ int -vedit2(char *fpath, int saveheader, int *islocal, int flags) +vedit2(const char *fpath, int saveheader, int *islocal, int flags) { char last = 0; /* the last key you press */ int ch, tmp; @@ -3890,7 +3889,7 @@ vedit2(char *fpath, int saveheader, int *islocal, int flags) } int -vedit(char *fpath, int saveheader, int *islocal) +vedit(const char *fpath, int saveheader, int *islocal) { return vedit2(fpath, saveheader, islocal, EDITFLAG_ALLOWTITLE); } diff --git a/mbbsd/mail.c b/mbbsd/mail.c index 60d2b34f..33fb6bf2 100644 --- a/mbbsd/mail.c +++ b/mbbsd/mail.c @@ -18,6 +18,7 @@ enum SHOWMAIL_MODES { }; static int showmail_mode = SHOWMAIL_NORM; +// #ifdef USE_MAIL_AUTO_FORWARD int setforward(void) { @@ -61,6 +62,7 @@ setforward(void) vmsg("取消自動轉信!"); return 0; } +// #endif // USE_MAIL_AUTO_FORWARD int toggle_showmail_mode(void) @@ -401,6 +403,9 @@ do_send(const char *userid, const char *title) if (internet_mail) { int res, ch; + sethomepath(fpath, cuser.userid); + stampfile(fpath, &mhdr); + if (vedit(fpath, NA, NULL) == -1) { unlink(fpath); clear(); diff --git a/mbbsd/menu.c b/mbbsd/menu.c index e34685db..0b335353 100644 --- a/mbbsd/menu.c +++ b/mbbsd/menu.c @@ -402,8 +402,10 @@ static const commands_t maillist[] = { {m_send, PERM_LOGINOK, "RSend 站內寄信"}, {mail_list, PERM_LOGINOK, "RMail List 群組寄信"}, {x_love, PERM_LOGINOK, "PPaper 情書產生器"}, +// #ifdef USE_MAIL_AUTO_FORWARD {setforward, PERM_LOGINOK, "FForward " ANSI_COLOR(1;32) "設定信箱自動轉寄" ANSI_RESET}, +// #endif // USE_MAIL_AUTO_FORWARD {m_sysop, 0, "YYes, sir! 寫信給站長"}, {m_internet, PERM_INTERNET, "RInternet 寄信到站外"}, {mail_mbox, PERM_INTERNET, "RZip UserHome 把所有私人資料打包回去"}, @@ -488,7 +490,6 @@ static const commands_t userlist[] = { #ifdef DEBUG int _debug_check_keyinput(); -int _debug_testregcode(); int _debug_reportstruct() { clear(); @@ -528,8 +529,6 @@ static const commands_t xyzlist[] = { #else {_debug_check_keyinput, 0, "MMKeycode 檢查按鍵控制碼工具"}, - {_debug_testregcode, 0, - "RRegcode 檢查註冊碼公式"}, {_debug_reportstruct, 0, "RReportStruct 報告各種結構的大小"}, #endif diff --git a/mbbsd/record.c b/mbbsd/record.c index 48c61fe2..4fe5e076 100644 --- a/mbbsd/record.c +++ b/mbbsd/record.c @@ -586,6 +586,7 @@ append_record(const char *fpath, const fileheader_t * record, int size) int append_record_forward(char *fpath, fileheader_t * record, int size, const char *origid) { +// #ifdef USE_MAIL_AUTO_FORWARD #if !defined(_BBS_UTIL_C_) if (get_num_records(fpath, sizeof(fileheader_t)) <= MAX_KEEPMAIL * 2) { FILE *fp; @@ -636,6 +637,7 @@ append_record_forward(char *fpath, fileheader_t * record, int size, const char * } } #endif +// #endif // USE_MAIL_AUTO_FORWARD append_record(fpath, record, size); diff --git a/mbbsd/register.c b/mbbsd/register.c index 5b96035e..0a49fde4 100644 --- a/mbbsd/register.c +++ b/mbbsd/register.c @@ -863,6 +863,7 @@ toregister(char *email, char *phone, char *career, char *mobile) while (1) { email[0] = 0; getfield(15, "身分認證用", "E-Mail Address", email, 50); + strip_blank(email, email); if (strcmp(email, "X") == 0) email[0] = 'x'; if (strcmp(email, "x") == 0) break; |