diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-08-28 22:15:05 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-08-28 22:15:05 +0800 |
commit | f70549636d72d203ed0f50fb66688319c3fcb878 (patch) | |
tree | 0dc6840fb974b8fc0c6f148761e16852c839c74e /mbbsd | |
parent | 2230c0a8c5a4eb2397673d37e709454195c5e284 (diff) | |
download | pttbbs-f70549636d72d203ed0f50fb66688319c3fcb878.tar pttbbs-f70549636d72d203ed0f50fb66688319c3fcb878.tar.gz pttbbs-f70549636d72d203ed0f50fb66688319c3fcb878.tar.bz2 pttbbs-f70549636d72d203ed0f50fb66688319c3fcb878.tar.lz pttbbs-f70549636d72d203ed0f50fb66688319c3fcb878.tar.xz pttbbs-f70549636d72d203ed0f50fb66688319c3fcb878.tar.zst pttbbs-f70549636d72d203ed0f50fb66688319c3fcb878.zip |
* modify more APIs
git-svn-id: http://opensvn.csie.org/pttbbs/branches/pttbbs.pwcu@4784 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/cache.c | 2 | ||||
-rw-r--r-- | mbbsd/passwd.c | 73 | ||||
-rw-r--r-- | mbbsd/talk.c | 2 |
3 files changed, 45 insertions, 32 deletions
diff --git a/mbbsd/cache.c b/mbbsd/cache.c index e56c162a..e9d057c4 100644 --- a/mbbsd/cache.c +++ b/mbbsd/cache.c @@ -160,7 +160,7 @@ int is_BM_cache(int bid) /* bid starts from 1 */ { // auto enable BM permission if (!HasUserPerm(PERM_BM)) - cuser.userlevel |= PERM_BM; + pwcuBitSetLevel(PERM_BM); return 1; } return 0; diff --git a/mbbsd/passwd.c b/mbbsd/passwd.c index b1a240a6..e529a874 100644 --- a/mbbsd/passwd.c +++ b/mbbsd/passwd.c @@ -149,14 +149,6 @@ pwcuSetGoodPost(unsigned int newgp) PWCU_END(); } -int -pwcuSetSignature(unsigned char newsig) -{ - PWCU_START(); - cuser.signature = u.signature = newsig; - PWCU_END(); -} - int pwcuViolateLaw () { @@ -188,6 +180,30 @@ pwcuAddExMailBox(int m) PWCU_END(); } +int pwcuSetLastSongTime (time4_t clk) +{ + PWCU_START(); + u.lastsong = clk; + cuser.lastsong = clk; + PWCU_END(); +} + +int pwcuSetMyAngel (const char *angel_uid) +{ + PWCU_START(); + strlcpy(u.myangel, angel_uid, sizeof(u.myangel)); + strlcpy(cuser.myangel, angel_uid, sizeof(cuser.myangel)); + PWCU_END(); +} + +int pwcuSetNickname (const char *nickname) +{ + PWCU_START(); + strlcpy(u.nickname, nickname, sizeof(u.nickname)); + strlcpy(cuser.nickname, nickname, sizeof(cuser.nickname)); + PWCU_END(); +} + int pwcuToggleOutMail() { @@ -206,41 +222,38 @@ pwcuSetLoginView(unsigned int bits) PWCU_END(); } + +// non-important variables (only save on exit) + +int +pwcuSetSignature(unsigned char newsig) +{ + cuser.signature = newsig; + return 0; +} + int pwcuSetWaterballMode(unsigned int bm) { - PWCU_START(); - bm &= WATER_MASK; - u.uflag2 &= ~WATER_MASK; + bm &= WATER_MASK; cuser.uflag2 &= ~WATER_MASK; - u.uflag2 |= bm; cuser.uflag2 |= bm; - PWCU_END(); + return 0; } -int pwcuSetLastSongTime (time4_t clk) +int pwcuToggleSortBoard () { - PWCU_START(); - u.lastsong = clk; - cuser.lastsong = clk; - PWCU_END(); + cuser.uflag ^= BRDSORT_FLAG; + return 0; } -int pwcuSetMyAngel (const char *angel_uid) +int pwcuToggleFriendList() { - PWCU_START(); - strlcpy(u.myangel, angel_uid, sizeof(u.myangel)); - strlcpy(cuser.myangel, angel_uid, sizeof(cuser.myangel)); - PWCU_END(); + cuser.uflag ^= FRIEND_FLAG; + return 0; } -int pwcuSetNickname (const char *nickname) -{ - PWCU_START(); - strlcpy(u.nickname, nickname, sizeof(u.nickname)); - strlcpy(cuser.nickname, nickname, sizeof(cuser.nickname)); - PWCU_END(); -} +// session save #if 0 static void 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; |