From 2230c0a8c5a4eb2397673d37e709454195c5e284 Mon Sep 17 00:00:00 2001 From: piaip Date: Fri, 28 Aug 2009 13:57:40 +0000 Subject: * moving into the new pwcu (password - current user helper) API git-svn-id: http://opensvn.csie.org/pttbbs/branches/pttbbs.pwcu@4783 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/talk.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'mbbsd/talk.c') diff --git a/mbbsd/talk.c b/mbbsd/talk.c index f1a884d7..d7925696 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -2999,10 +2999,11 @@ userlist(void) if (HasUserPerm(PERM_LOGINOK)) { int tmp; char *wm[3] = {"一般", "進階", "未來"}; + + tmp = cuser.uflag2 & WATER_MASK; - cuser.uflag2 -= tmp; tmp = (tmp + 1) % 3; - cuser.uflag2 |= tmp; + pwcuSetWaterballMode(tmp); /* vmsg cannot support multi lines */ move(b_lines - 4, 0); clrtobot(); @@ -3035,7 +3036,7 @@ userlist(void) if (getdata_str(1, 0, "新的暱稱: ", tmp_nick, sizeof(tmp_nick), DOECHO, cuser.nickname) > 0) { - strlcpy(cuser.nickname, tmp_nick, sizeof(cuser.nickname)); + pwcuSetNickname(tmp_nick); strlcpy(currutmp->nickname, cuser.nickname, sizeof(currutmp->nickname)); } redrawall = redraw = 1; -- cgit v1.2.3 From f70549636d72d203ed0f50fb66688319c3fcb878 Mon Sep 17 00:00:00 2001 From: piaip Date: Fri, 28 Aug 2009 14:15:05 +0000 Subject: * modify more APIs git-svn-id: http://opensvn.csie.org/pttbbs/branches/pttbbs.pwcu@4784 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/talk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mbbsd/talk.c') diff --git a/mbbsd/talk.c b/mbbsd/talk.c index d7925696..f04c4ddb 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -2914,7 +2914,7 @@ userlist(void) case 'f': if (HasUserPerm(PERM_LOGINOK)) { - cuser.uflag ^= FRIEND_FLAG; + pwcuToggleFriendList(); redrawall = redraw = 1; } break; -- cgit v1.2.3 From e40b5f174956a652514959e367df348c0ad66d9f Mon Sep 17 00:00:00 2001 From: piaip Date: Sat, 29 Aug 2009 12:59:17 +0000 Subject: * enable lastseen and CONST_CUSER, also use cuser_ref as "&cuser". git-svn-id: http://opensvn.csie.org/pttbbs/branches/pttbbs.pwcu@4786 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/talk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mbbsd/talk.c') diff --git a/mbbsd/talk.c b/mbbsd/talk.c index f04c4ddb..068cd567 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -458,7 +458,7 @@ my_query(const char *uident) { // XXX there're still users asking why money is not updated... reload_money(); - memcpy(&muser, &cuser, sizeof(muser)); + memcpy(&muser, cuser_ref, sizeof(muser)); } if ((uentp = (userinfo_t *) search_ulist(tuid))) @@ -494,7 +494,7 @@ my_query(const char *uident) ? "《私人信箱》有新進信件還沒看\n" : "《私人信箱》所有信件都看過了\n"); prints("《上次上站》%-28.28s《上次故鄉》", - Cdate(&muser.lastlogin)); + Cdate(&muser.lastseen)); // print out muser.lasthost #ifdef USE_MASKED_FROMHOST if(!HasUserPerm(PERM_SYSOP|PERM_ACCOUNTS)) -- cgit v1.2.3 From 6b2f2f3e275322f0cfeccf57d35350edae0de6a0 Mon Sep 17 00:00:00 2001 From: piaip Date: Sat, 29 Aug 2009 14:31:57 +0000 Subject: * (pwcu branch) remove the 'goodpost' ~ I love this commit. git-svn-id: http://opensvn.csie.org/pttbbs/branches/pttbbs.pwcu@4791 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/talk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mbbsd/talk.c') diff --git a/mbbsd/talk.c b/mbbsd/talk.c index 068cd567..14f55478 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -481,7 +481,7 @@ my_query(const char *uident) #endif move(2, 40); #ifdef ASSESS - prints("《有效文章篇數》%d篇 (優:%d/劣:%d)\n", muser.numposts, muser.goodpost, muser.badpost); + prints("《有效文章篇數》%d篇 (劣:%d)\n", muser.numposts, muser.badpost); #else prints("《有效文章篇數》%d篇\n", muser.numposts); #endif -- cgit v1.2.3 From 2962ffe9d364a629996465a1cf08770791823db3 Mon Sep 17 00:00:00 2001 From: piaip Date: Sun, 30 Aug 2009 03:00:49 +0000 Subject: * (pwcu branch) make user compatible to pwcu API git-svn-id: http://opensvn.csie.org/pttbbs/branches/pttbbs.pwcu@4794 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/talk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mbbsd/talk.c') diff --git a/mbbsd/talk.c b/mbbsd/talk.c index 14f55478..bc728b8d 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -2835,7 +2835,7 @@ userlist(void) if ((id = getuser(uentp->userid, &muser)) > 0) { user_display(&muser, 1); if( HasUserPerm(PERM_ACCOUNTS) ) - uinfo_query(&muser, 1, id); + uinfo_query(muser.userid, 1, id); else pressanykey(); } -- cgit v1.2.3 From 37019e5c460e64a6dec35863d53603fbe9825ce1 Mon Sep 17 00:00:00 2001 From: piaip Date: Sun, 30 Aug 2009 08:25:07 +0000 Subject: * (pwcu branch) code refine, remove unused code, and finetune alerts git-svn-id: http://opensvn.csie.org/pttbbs/branches/pttbbs.pwcu@4796 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/talk.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'mbbsd/talk.c') diff --git a/mbbsd/talk.c b/mbbsd/talk.c index bc728b8d..da909076 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -450,16 +450,7 @@ my_query(const char *uident) move(1, 0); setutmpmode(TQUERY); currutmp->destuid = tuid; - - // XXX some users keep complaining that query result (for numpost) - // is not synced... - // well, make them happy now. - if (tuid == usernum) - { - // XXX there're still users asking why money is not updated... - reload_money(); - memcpy(&muser, cuser_ref, sizeof(muser)); - } + reload_money(); if ((uentp = (userinfo_t *) search_ulist(tuid))) fri_stat = friend_stat(currutmp, uentp); -- cgit v1.2.3 From 5f589c904a3be5b6eaa5abd57052b481d6a24c18 Mon Sep 17 00:00:00 2001 From: piaip Date: Sun, 30 Aug 2009 10:08:49 +0000 Subject: * fix numlogindays git-svn-id: http://opensvn.csie.org/pttbbs/branches/pttbbs.pwcu@4799 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/talk.c | 47 +++++++++++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 16 deletions(-) (limited to 'mbbsd/talk.c') diff --git a/mbbsd/talk.c b/mbbsd/talk.c index da909076..997e7e8e 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -455,37 +455,50 @@ my_query(const char *uident) if ((uentp = (userinfo_t *) search_ulist(tuid))) fri_stat = friend_stat(currutmp, uentp); - prints("《ID暱稱》%s (%s)%*s《經濟狀況》%s", + // ------------------------------------------------------------ + + prints( "《ID暱稱》%s (%s)%*s", muser.userid, muser.nickname, strlen(muser.userid) + strlen(muser.nickname) >= 25 ? 0 : - (int)(25 - strlen(muser.userid) - strlen(muser.nickname)), "", + (int)(25 - strlen(muser.userid) - strlen(muser.nickname)), ""); + + prints( "《經濟狀況》%s", money_level(muser.money)); if (uentp && ((fri_stat & HFM && !uentp->invisible) || strcmp(muser.userid,cuser.userid) == 0)) prints(" ($%d)", muser.money); outc('\n'); - prints("《上站次數》%d次", muser.numlogins); + // ------------------------------------------------------------ + + prints("《上站資歷》%d 點", muser.numlogindays); #ifdef SHOW_LOGINOK if (!(muser.userlevel & PERM_LOGINOK)) outs(" (尚未通過認證)"); #endif - move(2, 40); + + move(vgety(), 40); + prints("《有效文章》%d 篇", muser.numposts); #ifdef ASSESS - prints("《有效文章篇數》%d篇 (劣:%d)\n", muser.numposts, muser.badpost); -#else - prints("《有效文章篇數》%d篇\n", muser.numposts); + prints(" (劣:%d)", muser.badpost); #endif + outc('\n'); + + // ------------------------------------------------------------ prints(ANSI_COLOR(1;33) "《目前動態》%-28.28s" ANSI_RESET, (uentp && isvisible_stat(currutmp, uentp, fri_stat)) ? - modestring(uentp, 0) : "不在站上"); + modestring(uentp, 0) : "不在站上"); + + if ((uentp && ISNEWMAIL(uentp)) || load_mailalert(muser.userid)) + outs("《私人信箱》有新進信件還沒看\n"); + else + outs("《私人信箱》所有信件都看過了\n"); + + // ------------------------------------------------------------ - outs(((uentp && ISNEWMAIL(uentp)) || load_mailalert(muser.userid)) - ? "《私人信箱》有新進信件還沒看\n" : - "《私人信箱》所有信件都看過了\n"); prints("《上次上站》%-28.28s《上次故鄉》", - Cdate(&muser.lastseen)); + Cdate(muser.lastseen ? &muser.lastseen : &muser.lastlogin)); // print out muser.lasthost #ifdef USE_MASKED_FROMHOST if(!HasUserPerm(PERM_SYSOP|PERM_ACCOUNTS)) @@ -494,8 +507,10 @@ my_query(const char *uident) outs(muser.lasthost[0] ? muser.lasthost : "(不詳)"); outs("\n"); - prints("《五子棋戰績》%3d 勝 %3d 敗 %3d 和 " - "《象棋戰績》%3d 勝 %3d 敗 %3d 和\n", + // ------------------------------------------------------------ + + prints("《 五子棋 》%5d 勝 %5d 敗 %5d 和 " + "《象棋戰績》%5d 勝 %5d 敗 %5d 和\n", muser.five_win, muser.five_lose, muser.five_tie, muser.chc_win, muser.chc_lose, muser.chc_tie); @@ -3292,8 +3307,8 @@ talkreply(void) strlcpy(currutmp->msgs[0].last_call_in, "呼叫、呼叫,聽到請回答 (Ctrl-R)", sizeof(currutmp->msgs[0].last_call_in)); currutmp->msgs[0].msgmode = MSGMODE_TALK; - prints("對方來自 [%s],共上站 %d 次,文章 %d 篇\n", - uip->from, xuser.numlogins, xuser.numposts); + prints("對方來自 [%s],上站資歷 %d 點,文章共 %d 篇\n", + uip->from, xuser.numlogindays, xuser.numposts); if (is_chess) ChessShowRequest(); -- cgit v1.2.3 From 2933c380c0ffa5422cc5bc74e23e6a92440cca92 Mon Sep 17 00:00:00 2001 From: piaip Date: Sat, 5 Sep 2009 14:22:59 +0000 Subject: * change display name of numlogindays to macro (we may change it again in future) git-svn-id: http://opensvn.csie.org/pttbbs/branches/pttbbs.pwcu@4809 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/talk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mbbsd/talk.c') diff --git a/mbbsd/talk.c b/mbbsd/talk.c index 997e7e8e..2ed5b5c8 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -471,7 +471,7 @@ my_query(const char *uident) // ------------------------------------------------------------ - prints("《上站資歷》%d 點", muser.numlogindays); + prints("《" STR_LOGINDAYS "》%d ", muser.numlogindays); #ifdef SHOW_LOGINOK if (!(muser.userlevel & PERM_LOGINOK)) outs(" (尚未通過認證)"); @@ -3307,7 +3307,7 @@ talkreply(void) strlcpy(currutmp->msgs[0].last_call_in, "呼叫、呼叫,聽到請回答 (Ctrl-R)", sizeof(currutmp->msgs[0].last_call_in)); currutmp->msgs[0].msgmode = MSGMODE_TALK; - prints("對方來自 [%s],上站資歷 %d 點,文章共 %d 篇\n", + prints("對方來自 [%s]," STR_LOGINDAYS " %d ,文章共 %d 篇\n", uip->from, xuser.numlogindays, xuser.numposts); if (is_chess) -- cgit v1.2.3 From e2a6b4b4502bd8926777c9b17747e65528422464 Mon Sep 17 00:00:00 2001 From: piaip Date: Sun, 6 Sep 2009 13:38:14 +0000 Subject: * refine message with quantity git-svn-id: http://opensvn.csie.org/pttbbs/branches/pttbbs.pwcu@4813 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/talk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mbbsd/talk.c') diff --git a/mbbsd/talk.c b/mbbsd/talk.c index 2ed5b5c8..b11799c5 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -471,7 +471,7 @@ my_query(const char *uident) // ------------------------------------------------------------ - prints("《" STR_LOGINDAYS "》%d ", muser.numlogindays); + prints("《" STR_LOGINDAYS "》%d " STR_LOGINDAYS_QTY, muser.numlogindays); #ifdef SHOW_LOGINOK if (!(muser.userlevel & PERM_LOGINOK)) outs(" (尚未通過認證)"); @@ -3307,7 +3307,7 @@ talkreply(void) strlcpy(currutmp->msgs[0].last_call_in, "呼叫、呼叫,聽到請回答 (Ctrl-R)", sizeof(currutmp->msgs[0].last_call_in)); currutmp->msgs[0].msgmode = MSGMODE_TALK; - prints("對方來自 [%s]," STR_LOGINDAYS " %d ,文章共 %d 篇\n", + prints("對方來自 [%s]," STR_LOGINDAYS " %d " STR_LOGINDAYS_QTY ",文章共 %d 篇\n", uip->from, xuser.numlogindays, xuser.numposts); if (is_chess) -- cgit v1.2.3 From d4d7b4113cf03c906f9d408526b0dee082adde53 Mon Sep 17 00:00:00 2001 From: piaip Date: Mon, 7 Sep 2009 02:11:19 +0000 Subject: * allow query old login number (for self only) * merge latest git-svn-id: http://opensvn.csie.org/pttbbs/branches/pttbbs.pwcu@4816 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/talk.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'mbbsd/talk.c') diff --git a/mbbsd/talk.c b/mbbsd/talk.c index b11799c5..5c906e9c 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -436,6 +436,7 @@ my_query(const char *uident) { userec_t muser; int tuid, fri_stat = 0; + int is_self = 0; userinfo_t *uentp; const char *sex[8] = {MSG_BIG_BOY, MSG_BIG_GIRL, @@ -454,6 +455,8 @@ my_query(const char *uident) if ((uentp = (userinfo_t *) search_ulist(tuid))) fri_stat = friend_stat(currutmp, uentp); + if (strcmp(muser.userid, cuser.userid) == 0) + is_self =1; // ------------------------------------------------------------ @@ -465,17 +468,23 @@ my_query(const char *uident) prints( "《經濟狀況》%s", money_level(muser.money)); - if (uentp && ((fri_stat & HFM && !uentp->invisible) || strcmp(muser.userid,cuser.userid) == 0)) + if (uentp && ((fri_stat & HFM && !uentp->invisible) || is_self)) prints(" ($%d)", muser.money); outc('\n'); // ------------------------------------------------------------ prints("《" STR_LOGINDAYS "》%d " STR_LOGINDAYS_QTY, muser.numlogindays); + + if (is_self && muser.old_numlogins) + prints(" (舊值: %d) ", muser.old_numlogins); + else + { #ifdef SHOW_LOGINOK if (!(muser.userlevel & PERM_LOGINOK)) outs(" (尚未通過認證)"); #endif + } move(vgety(), 40); prints("《有效文章》%d 篇", muser.numposts); @@ -514,7 +523,7 @@ my_query(const char *uident) muser.five_win, muser.five_lose, muser.five_tie, muser.chc_win, muser.chc_lose, muser.chc_tie); - if ((uentp && ((fri_stat & HFM) || strcmp(muser.userid,cuser.userid) == 0) && !uentp->invisible)) + if ((uentp && ((fri_stat & HFM) || is_self) && !uentp->invisible)) prints("《 性 別 》%-28.28s\n", sex[muser.sex % 8]); showplans_userec(&muser); -- cgit v1.2.3 From dfeb1a9e710617bb8b800ec0a11350d1c9f79489 Mon Sep 17 00:00:00 2001 From: piaip Date: Mon, 7 Sep 2009 05:54:36 +0000 Subject: * move oldnumlogin display from talk=>query to user=>info. git-svn-id: http://opensvn.csie.org/pttbbs/branches/pttbbs.pwcu@4817 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/talk.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'mbbsd/talk.c') diff --git a/mbbsd/talk.c b/mbbsd/talk.c index 5c906e9c..e807cf64 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -475,16 +475,10 @@ my_query(const char *uident) // ------------------------------------------------------------ prints("《" STR_LOGINDAYS "》%d " STR_LOGINDAYS_QTY, muser.numlogindays); - - if (is_self && muser.old_numlogins) - prints(" (舊值: %d) ", muser.old_numlogins); - else - { #ifdef SHOW_LOGINOK if (!(muser.userlevel & PERM_LOGINOK)) outs(" (尚未通過認證)"); #endif - } move(vgety(), 40); prints("《有效文章》%d 篇", muser.numposts); -- cgit v1.2.3