diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2014-02-18 19:34:21 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2014-02-18 19:34:21 +0800 |
commit | 81cba93580bc38d0d51d1f04d42e4f45ab5ca3e7 (patch) | |
tree | f16ae3e32e299b4a7b865c4800f3e04d66c0e596 | |
parent | e4aebf5da763af641998085d15e2aef4ea94b5d1 (diff) | |
download | pttbbs-81cba93580bc38d0d51d1f04d42e4f45ab5ca3e7.tar pttbbs-81cba93580bc38d0d51d1f04d42e4f45ab5ca3e7.tar.gz pttbbs-81cba93580bc38d0d51d1f04d42e4f45ab5ca3e7.tar.bz2 pttbbs-81cba93580bc38d0d51d1f04d42e4f45ab5ca3e7.tar.lz pttbbs-81cba93580bc38d0d51d1f04d42e4f45ab5ca3e7.tar.xz pttbbs-81cba93580bc38d0d51d1f04d42e4f45ab5ca3e7.tar.zst pttbbs-81cba93580bc38d0d51d1f04d42e4f45ab5ca3e7.zip |
Drop the stupid <mind>.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5935 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/include/pttstruct.h | 6 | ||||
-rw-r--r-- | pttbbs/mbbsd/mbbsd.c | 4 | ||||
-rw-r--r-- | pttbbs/mbbsd/passwd.c | 5 | ||||
-rw-r--r-- | pttbbs/mbbsd/talk.c | 14 | ||||
-rw-r--r-- | pttbbs/mbbsd/user.c | 27 |
5 files changed, 6 insertions, 50 deletions
diff --git a/pttbbs/include/pttstruct.h b/pttbbs/include/pttstruct.h index 6ee553fe..ffe914cf 100644 --- a/pttbbs/include/pttstruct.h +++ b/pttbbs/include/pttstruct.h @@ -96,7 +96,7 @@ typedef struct userec_t { time4_t timesetangel; /* 上次得到天使時間 */ time4_t timeplayangel; /* 上次與天使互動時間 (by day) */ // 以上應為 sizeof(chicken_t) 同等大小 - + time4_t lastsong; /* 上次點歌時間 */ uint32_t loginview; /* 進站畫面 */ uint8_t _unused8; // was: channel @@ -110,7 +110,7 @@ typedef struct userec_t { uint16_t chc_lose; /* 象棋戰績 敗 */ uint16_t chc_tie; /* 象棋戰績 和 */ uint32_t _unused11; /* 舊手機號碼 */ - char mind[4]; /* 心情 XXX not a null-terminate string */ + char _unused_mind[4];/* 舊心情 */ uint16_t go_win; /* 圍棋戰績 勝 */ uint16_t go_lose; /* 圍棋戰績 敗 */ uint16_t go_tie; /* 圍棋戰績 和 */ @@ -374,7 +374,7 @@ typedef struct userinfo_t { char _unused5[3]; time4_t lastact; /* 上次使用者動的時間 */ char alerts; /* mail alert, passwd update... */ - char mind[4]; + char _unused_mind[4]; /* chatroom/talk/games calling */ unsigned char sig; /* signal type */ diff --git a/pttbbs/mbbsd/mbbsd.c b/pttbbs/mbbsd/mbbsd.c index 4a72f87a..ccaf8441 100644 --- a/pttbbs/mbbsd/mbbsd.c +++ b/pttbbs/mbbsd/mbbsd.c @@ -922,9 +922,6 @@ setup_utmp(int mode) strlcpy(uinfo.nickname, cuser.nickname, sizeof(uinfo.nickname)); strlcpy(uinfo.from, fromhost, sizeof(uinfo.from)); - // 當初設計的人把 mind 設計成非 NULL terminated 的... - memcpy(uinfo.mind, cuser.mind, sizeof(cuser.mind)); - uinfo.five_win = cuser.five_win; uinfo.five_lose = cuser.five_lose; uinfo.five_tie = cuser.five_tie; @@ -955,7 +952,6 @@ setup_utmp(int mode) SHM->UTMPneedsort = 1; strip_nonebig5((unsigned char *)currutmp->nickname, sizeof(currutmp->nickname)); - strip_nonebig5((unsigned char *)currutmp->mind, sizeof(currutmp->mind)); #ifdef FROMD // resolve fromhost diff --git a/pttbbs/mbbsd/passwd.c b/pttbbs/mbbsd/passwd.c index 9011bfaa..29ed4725 100644 --- a/pttbbs/mbbsd/passwd.c +++ b/pttbbs/mbbsd/passwd.c @@ -528,8 +528,7 @@ pwcuExitSave () if (pwcu_dirty || cuser.withme != currutmp->withme || cuser.pager != currutmp->pager || - cuser.invisible != currutmp->invisible || - (memcmp(cuser.mind,currutmp->mind, sizeof(cuser.mind)) != 0) ) + cuser.invisible != currutmp->invisible) { // maybe dirty, let's work harder. PWCU_START(); @@ -542,7 +541,6 @@ pwcuExitSave () u.withme = currutmp->withme; u.pager = currutmp->pager; u.invisible = currutmp->invisible; - memcpy(u.mind, currutmp->mind, sizeof(u.mind)); // XXX u.mind is NOT NULL-terminated. // configure those changed by 'not important variables' API u.signature = cuser.signature; @@ -636,5 +634,4 @@ void pwcuInitGuestInfo () strlcpy(currutmp->nickname, cuser.nickname, sizeof(currutmp->nickname)); strlcpy(cuser.realname, "guest", sizeof(cuser.realname)); - memset (cuser.mind, 0, sizeof(cuser.mind)); } diff --git a/pttbbs/mbbsd/talk.c b/pttbbs/mbbsd/talk.c index 35e121cd..b849a5f7 100644 --- a/pttbbs/mbbsd/talk.c +++ b/pttbbs/mbbsd/talk.c @@ -1524,7 +1524,6 @@ static const char " 增加好友", "a", " 刪除好友", "d", " 修改好友", "o", - " 設定心情", "i", " 互動回應方式","y", NULL, }, @@ -1898,7 +1897,7 @@ static const VCOL ulist_coldef[ULISTCOLS] = { {NULL, 17,25, 2}, // "暱稱", sizeof(userec_t::nickname) {NULL, 17,27, 1}, // "故鄉/棋類戰績/等級分" {NULL, 12,23, 1}, // "動態" (最大多少才合理?) modestring size=40 但... - {NULL, 4, 4, 0, {0, 0, 1}}, // "心情" + {NULL, 4, 4, 0, {0, 0, 1}}, // "<通緝>" (原心情) {NULL, 6, 6, -1, {0, 1, 1}}, // "發呆" (optional?) {NULL, 0, VCOL_MAXW, -1}, // for middle alignment }; @@ -1959,7 +1958,7 @@ draw_pickup(int drawall, pickup_t * pickup, int pickup_way, "暱稱", MODE_STRING[show_mode], show_board ? "看板" : "動態", - show_pid ? "PID" : "心情", + show_pid ? "PID" : "", idletime ? "發呆": "", ""); outs(ANSI_RESET); @@ -2041,9 +2040,6 @@ draw_pickup(int drawall, pickup_t * pickup, int pickup_way, if ((uentp->userlevel & PERM_VIOLATELAW)) memcpy(mind, "通緝", 4); - else - memcpy(mind, uentp->mind, 4); - mind[4] = 0; snprintf(num, sizeof(num), "%d", #ifdef SHOWUID @@ -2519,12 +2515,6 @@ userlist(void) } break; - case 'i': - if (HasBasicUserPerm(PERM_LOGINOK)) - u_set_mind(); - redrawall = redraw = 1; - break; - case Ctrl('S'): break; diff --git a/pttbbs/mbbsd/user.c b/pttbbs/mbbsd/user.c index e458d538..080d62f0 100644 --- a/pttbbs/mbbsd/user.c +++ b/pttbbs/mbbsd/user.c @@ -49,21 +49,6 @@ kill_user(int num, const char *userid) } int -u_set_mind() -{ - char mindbuf[sizeof(currutmp->mind)+1] = ""; - - // XXX 以往有 check 通緝/壽星,但我實在看不出這有什麼意義 - memcpy(mindbuf, currutmp->mind, sizeof(mindbuf)); - getdata_buf(b_lines - 1, 0, "現在的心情? ", mindbuf, sizeof(mindbuf), DOECHO); - if (memcmp(mindbuf, currutmp->mind, sizeof(currutmp->mind)) == 0) - return 0; - - memcpy(currutmp->mind, mindbuf, sizeof(currutmp->mind)); - return 1; -} - -int u_loginview(void) { int i, in; @@ -521,7 +506,6 @@ void Customize(void) } /* extended stuff */ { - char mindbuf[5]; static const char *wm[PAGER_UI_TYPES+1] = {"一般", "進階", "未來", ""}; @@ -530,13 +514,6 @@ void Customize(void) col_opt, "PAGER 水球模式", wm[cuser.pager_ui_type % PAGER_UI_TYPES]); - memcpy(mindbuf, &currutmp->mind, 4); - mindbuf[4] = 0; - prints("%c. %-*s%s\n", - '1' + iax++, - col_opt, - "MIND 目前的心情", - mindbuf); #ifdef PLAY_ANGEL // TODO move this to Ctrl-U Ctrl-P. if (HasUserPerm(PERM_ANGEL)) @@ -583,10 +560,6 @@ void Customize(void) dirty = 1; } continue; - case 1: - if (HasBasicUserPerm(PERM_LOGINOK) && u_set_mind()) - dirty = 1; - continue; } #ifdef PLAY_ANGEL if( HasUserPerm(PERM_ANGEL) ){ |