diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-09-24 18:08:55 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-09-24 18:08:55 +0800 |
commit | 28213391e5a961e0c407e0cbac05129ce4ee865e (patch) | |
tree | 307d820cbdf096d31318746610403bd25cab15be /mbbsd | |
parent | 59382a53ad9a87fcff1911be65d68e97099bbd90 (diff) | |
download | pttbbs-28213391e5a961e0c407e0cbac05129ce4ee865e.tar pttbbs-28213391e5a961e0c407e0cbac05129ce4ee865e.tar.gz pttbbs-28213391e5a961e0c407e0cbac05129ce4ee865e.tar.bz2 pttbbs-28213391e5a961e0c407e0cbac05129ce4ee865e.tar.lz pttbbs-28213391e5a961e0c407e0cbac05129ce4ee865e.tar.xz pttbbs-28213391e5a961e0c407e0cbac05129ce4ee865e.tar.zst pttbbs-28213391e5a961e0c407e0cbac05129ce4ee865e.zip |
* refine user->customize
* allow setting "dbcs evil client repeat detection"
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4881 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/register.c | 18 | ||||
-rw-r--r-- | mbbsd/telnet.c | 6 | ||||
-rw-r--r-- | mbbsd/user.c | 49 |
3 files changed, 43 insertions, 30 deletions
diff --git a/mbbsd/register.c b/mbbsd/register.c index 3db22103..3af845f5 100644 --- a/mbbsd/register.c +++ b/mbbsd/register.c @@ -717,15 +717,17 @@ new_register(void) #endif #ifdef DBCSAWARE -# ifdef DBCSAWARE_SKIP_EVIL_REPEATS_CHECK - if(u_detectDBCSAwareEvilClient()) - newuser.uflag &= ~UF_DBCSAWARE; - else - newuser.uflag |= UF_DBCSAWARE; -# else - // since we check for repeats, safe to set DBCS aware to user - newuser.uflag |= UF_DBCSAWARE; +# ifndef DBCSAWARE_SKIP_EVIL_REPEATS_CHECK + newuser.uflag |= UF_DBCS_DROP_REPEAT; # endif + // if we check for repeats, safe to set DBCS aware to user; + // otherwise use detection + if ((newuser.uflag & UF_DBCS_DROP_REPEAT) || + u_detectDBCSAwareEvilClient() ) { + newuser.uflag |= UF_DBCSAWARE; + } else { + newuser.uflag &= ~UF_DBCSAWARE; + } #endif more("etc/register", NA); diff --git a/mbbsd/telnet.c b/mbbsd/telnet.c index 22ad6234..4e7daf53 100644 --- a/mbbsd/telnet.c +++ b/mbbsd/telnet.c @@ -43,7 +43,7 @@ telnet_init(int do_init_cmd) telnet_ctx_send_init_cmds(ctx); } -#if defined(DBCSAWARE) && !defined(DBCSAWARE_SKIP_EVIL_REPEATS_CHECK) +#if defined(DBCSAWARE) ssize_t dbcs_detect_evil_repeats(unsigned char *buf, ssize_t l) { @@ -122,8 +122,8 @@ tty_read(unsigned char *buf, size_t max) if(l == 0 || (l < 0 && !(errno == EINTR || errno == EAGAIN))) abort_bbs(0); -#if defined(DBCSAWARE) && !defined(DBCSAWARE_SKIP_EVIL_REPEATS_CHECK) - if (ISDBCSAWARE()) +#if defined(DBCSAWARE) + if (ISDBCSAWARE() && HasUserFlag(UF_DBCS_DROP_REPEAT)) l = dbcs_detect_evil_repeats(buf, l); #endif diff --git a/mbbsd/user.c b/mbbsd/user.c index cee3106f..7336b436 100644 --- a/mbbsd/user.c +++ b/mbbsd/user.c @@ -397,6 +397,8 @@ void Customize(void) int dirty = 0; int key; + const int col_opt = 54; + /* cuser.uflag settings */ static const unsigned int masks1[] = { UF_ADBANNER, @@ -409,23 +411,25 @@ void Customize(void) UF_COLORED_MODMARK, #ifdef DBCSAWARE UF_DBCSAWARE, + UF_DBCS_DROP_REPEAT, UF_DBCS_NOINTRESC, #endif 0, }; static const char* desc1[] = { - "顯示動態看板", - "顯示使用者心情點播 (需開啟動態看板)", - "拒收站外信", - "預設備份信件與其它記錄", //"與聊天記錄", - "新板自動進我的最愛", - "單色顯示我的最愛", - "隱藏文章修改符號(推文/修文) (~)", - "改用色彩代替修改符號 (+)", + "ADBANNER 顯示動態看板", + "ADBANNER 顯示使用者心情點播(需開啟動態看板)", + "MAIL 拒收站外信", + "BACKUP 預設備份信件與其它記錄", //"與聊天記錄", + "MYFAV 新板自動進我的最愛", + "MYFAV 單色顯示我的最愛", + "MODMARK 隱藏文章修改符號(推文/修文) (~)", + "MODMARK 改用色彩代替修改符號 (+)", #ifdef DBCSAWARE - "自動偵測雙位元字集(如全型中文)", - "禁止在雙位元中使用色碼(去一字雙色)", + "DBCS 自動偵測雙位元字集(如全型中文)", + "DBCS 忽略連線程式為雙位元字集送出的重複按鍵", + "DBCS 禁止在雙位元中使用色碼(去除一字雙色)", #endif 0, }; @@ -437,7 +441,10 @@ void Customize(void) clear(); showtitle("個人化設定", "個人化設定"); move(2, 0); - outs("您目前的個人化設定: "); + outs("您目前的個人化設定: \n"); + prints(ANSI_COLOR(32)" %-11s%-*s%s" ANSI_RESET "\n", + "分類", col_opt-11, + "描述", "設定值"); move(4, 0); /* print uflag options */ @@ -445,8 +452,10 @@ void Customize(void) { clrtoeol(); prints( ANSI_COLOR(1;36) "%c" ANSI_RESET - ". %-40s%s\n", - 'a' + ia, desc1[i], + ". %-*s%s\n", + 'a' + ia, + col_opt, + desc1[i], HasUserFlag(masks1[i]) ? ANSI_COLOR(1;36) "是" ANSI_RESET : "否"); } @@ -456,15 +465,17 @@ void Customize(void) static const char *wm[PAGER_UI_TYPES+1] = {"一般", "進階", "未來", ""}; - prints("%c. %-40s%s\n", + prints("%c. %-*s%s\n", '1' + iax++, - "水球模式", + col_opt, + "PAGER 水球模式", wm[cuser.pager_ui_type % PAGER_UI_TYPES]); memcpy(mindbuf, &currutmp->mind, 4); mindbuf[4] = 0; - prints("%c. %-40s%s\n", + prints("%c. %-*s%s\n", '1' + iax++, - "目前的心情", + col_opt, + "MIND 目前的心情", mindbuf); #ifdef PLAY_ANGEL if (HasUserPerm(PERM_ANGEL)) @@ -474,9 +485,9 @@ void Customize(void) "停收 (只接受已回應過的小主人的問題)", "關閉 (停止接受所有小主人的問題)", }; - prints("%c. %-40s%s\n", + prints("%c. %s%s\n", '1' + iax++, - "小天使神諭呼叫器", + "ANGEL 小天使神諭呼叫器: ", msgs[currutmp->angelpause % ANGELPAUSE_MODES]); } #endif // PLAY_ANGEL |