diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-12-17 16:25:17 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-12-17 16:25:17 +0800 |
commit | 3fb29022e04342c0a6c9112d578f44ae736c7e00 (patch) | |
tree | 11bf2ea06ef659624c15ce408362c88b44ce97fc | |
parent | d023f75854cf77c29a1d2b52635bab90dc370fa1 (diff) | |
download | pttbbs-3fb29022e04342c0a6c9112d578f44ae736c7e00.tar pttbbs-3fb29022e04342c0a6c9112d578f44ae736c7e00.tar.gz pttbbs-3fb29022e04342c0a6c9112d578f44ae736c7e00.tar.bz2 pttbbs-3fb29022e04342c0a6c9112d578f44ae736c7e00.tar.lz pttbbs-3fb29022e04342c0a6c9112d578f44ae736c7e00.tar.xz pttbbs-3fb29022e04342c0a6c9112d578f44ae736c7e00.tar.zst pttbbs-3fb29022e04342c0a6c9112d578f44ae736c7e00.zip |
- add "fix aloha" for users
- general message finetune
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3701 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | include/proto.h | 1 | ||||
-rw-r--r-- | mbbsd/bbs.c | 2 | ||||
-rw-r--r-- | mbbsd/friend.c | 73 | ||||
-rw-r--r-- | mbbsd/menu.c | 1 | ||||
-rw-r--r-- | sample/etc/board.help | 9 |
5 files changed, 66 insertions, 20 deletions
diff --git a/include/proto.h b/include/proto.h index cc69cda3..31d0b00a 100644 --- a/include/proto.h +++ b/include/proto.h @@ -284,6 +284,7 @@ void friend_edit(int type); void friend_load(int); int t_override(void); int t_reject(void); +int t_fix_aloha(); void friend_add(const char *uident, int type, const char *des); void friend_delete(const char *uident, int type); void friend_delete_all(const char *uident, int type); diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index 8056ae55..bec7484c 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -2496,7 +2496,9 @@ recommend(int ent, fileheader_t * fhdr, const char *direct) int isGuest = (strcmp(cuser.userid, STR_GUEST) == EQUSTR); int logIP = 0; int ymsg = b_lines -1; +#ifdef ASSESS char oldrecom = fhdr->recommend; +#endif // ASSESS assert(0<=currbid-1 && currbid-1<MAX_BOARD); bp = getbcache(currbid); diff --git a/mbbsd/friend.c b/mbbsd/friend.c index a3e77f0d..53208cbc 100644 --- a/mbbsd/friend.c +++ b/mbbsd/friend.c @@ -200,9 +200,10 @@ friend_append(int type, int count) static int delete_friend_from_file(const char *file, const char *string, int case_sensitive) { - FILE *fp, *nfp = NULL; - char fnew[80]; - char genbuf[STRLEN + 1]; + FILE *fp = NULL, *nfp = NULL; + char fnew[PATHLEN]; + char genbuf[STRLEN + 1]; + int ret = 0; sprintf(fnew, "%s.%3.3X", file, (unsigned int)(random() & 0xFFF)); if ((fp = fopen(file, "r")) && (nfp = fopen(fnew, "w"))) { @@ -213,6 +214,8 @@ delete_friend_from_file(const char *file, const char *string, int case_sensitiv if (((case_sensitive && strcmp(buf, string)) || (!case_sensitive && strcasecmp(buf, string)))) fputs(genbuf, nfp); + else + ret = 1; } Rename(fnew, file); } @@ -220,7 +223,7 @@ delete_friend_from_file(const char *file, const char *string, int case_sensitiv fclose(fp); if(nfp) fclose(nfp); - return 0; + return ret; } void @@ -234,17 +237,9 @@ friend_delete(const char *uident, int type) static void delete_user_friend(const char *uident, const char *thefriend, int type) { - char fn[80]; -#if 0 - if (type == FRIEND_ALOHA) { -#endif - sethomefile(fn, uident, "aloha"); - delete_friend_from_file(fn, thefriend, 0); -#if 0 - } - else { - } -#endif + char fn[PATHLEN]; + sethomefile(fn, uident, "aloha"); + delete_friend_from_file(fn, thefriend, 0); } void @@ -525,3 +520,51 @@ t_reject(void) friend_edit(FRIEND_REJECT); return 0; } + +int +t_fix_aloha() +{ + char xid[IDLEN+1] = ""; + char fn[PATHLEN] = ""; + + clear(); + stand_title("修正上站通知"); + + outs("\n\n▲如果你遇到有人沒在你的上站通知名單內但又會一直丟水球給你,\n" + " 請輸入他的 ID。\n\n"); + + move(1, 0); + usercomplete("有誰不在名單內又會送上站通知給您呢? ", xid); + + if (!xid[0]) + { + vmsg("修正結束。"); + return 0; + } + + // check by xid + move(5, 0); + outs("檢查中...\n"); + + // xid in my override list? + setuserfile(fn, "alohaed"); + if (belong(fn, xid)) + { + prints(ANSI_COLOR(1;32) "[%s] 確實在你的上站通知名單內。" + "請編輯 [上站通知名單]。" ANSI_RESET "\n", xid); + vmsg("不需修正。"); + return 0; + } + + sethomefile(fn, xid, "aloha"); + if (delete_friend_from_file(fn, cuser.userid, 0)) + { + outs(ANSI_COLOR(1;33) "已找到錯誤並修復完成。" ANSI_RESET "\n"); + } else { + outs(ANSI_COLOR(1;31) "找不到錯誤... 打錯 ID 了?" ANSI_RESET "\n"); + } + + vmsg("若上站通知錯誤仍持續發生請通知站方處理。"); + return 0; +} + diff --git a/mbbsd/menu.c b/mbbsd/menu.c index 710494ab..a6a7af96 100644 --- a/mbbsd/menu.c +++ b/mbbsd/menu.c @@ -446,6 +446,7 @@ static const commands_t namelist[] = { {t_override, PERM_LOGINOK,"OOverRide 好友名單"}, {t_reject, PERM_LOGINOK, "BBlack 壞人名單"}, {t_aloha,PERM_LOGINOK, "AALOHA 上站通知名單"}, + {t_fix_aloha,PERM_LOGINOK,"XXFixALOHA 修正上站通知"}, #ifdef POSTNOTIFY {t_post,PERM_LOGINOK, "NNewPost 新文章通知名單"}, #endif diff --git a/sample/etc/board.help b/sample/etc/board.help index 41e04b35..7b21fc7d 100644 --- a/sample/etc/board.help +++ b/sample/etc/board.help @@ -1,8 +1,8 @@ [1m【 全功能看板操作說明 】[m [36m【 基本命令 】[m - (p/↑)/(n/↓) 上移/下移一篇文章 (數字鍵) 跳到指定號碼的文章 -(P/PgUp)(N/PgDn) 下移/下移一頁 (Home)/(End/$) 跳到首篇/末篇文章 + (k/↑)/(j/↓) 上移/下移一篇文章 (^B/PgUp)(^F/PgDn) 下移/下移一頁 + (數字鍵) 跳到指定號碼的文章 (Home)/(End/$) 跳到首篇/末篇文章 (r)(→) 閱讀此篇文章 (=[]<>-+S) 主題式閱讀 (^P)/(y)/(X) [1m發表/回覆/推薦文章[m (F/U)/(x) 轉寄至信箱/轉錄至其它看板 @@ -17,6 +17,5 @@ (M/o) 舉行投票/編輯投票名單 (m/c/g/^Z) 保留/選錄精華/文摘/置底 (D) 刪除一段範圍的文章 (Y) 取消推薦文章 (T/B) 重編文章標題/重編看板標題 (t/^D) 標記文章/砍除標記的文章 - (O)/(i) 發表注意事項/文章類別 (W)/(K)/(v) 編進板畫面/水桶/可見名單 - (^G) 舉辦賭盤/停止下注/開獎 (H) 切換看板隱藏 - (I) 看板設定(隱藏,推文,...) + (^G) 舉辦賭盤/停止下注/開獎 (W) 編進板畫面 + (I) 看板設定(隱藏,推文,...) |