diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-04-03 21:42:22 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-04-03 21:42:22 +0800 |
commit | a4f496f0c13fb087296e9091f005d29af22a90ec (patch) | |
tree | 8e4360213877899c62cc793b0962c6bbb93acfbf /mbbsd/bbs.c | |
parent | 09ad37923288982a63098a7aa346ea79748f7eca (diff) | |
download | pttbbs-a4f496f0c13fb087296e9091f005d29af22a90ec.tar pttbbs-a4f496f0c13fb087296e9091f005d29af22a90ec.tar.gz pttbbs-a4f496f0c13fb087296e9091f005d29af22a90ec.tar.bz2 pttbbs-a4f496f0c13fb087296e9091f005d29af22a90ec.tar.lz pttbbs-a4f496f0c13fb087296e9091f005d29af22a90ec.tar.xz pttbbs-a4f496f0c13fb087296e9091f005d29af22a90ec.tar.zst pttbbs-a4f496f0c13fb087296e9091f005d29af22a90ec.zip |
- support anonymous commenting for angel system (use with caution - define ANGEL_ANONYMOUS_COMMENT to enable)
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4073 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/bbs.c')
-rw-r--r-- | mbbsd/bbs.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index b34fc496..ad1ee541 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -2660,6 +2660,10 @@ recommend(int ent, fileheader_t * fhdr, const char *direct) { struct tm *ptime = localtime4(&now); char buf[PATHLEN], msg[STRLEN]; + const char *myid = cuser.userid; +#if defined(PLAY_ANGEL) && defined(BN_ANGELPRAY) + char mynick[IDLEN+1]; +#endif // PLAY_ANGEL #ifndef OLDRECOMMEND static const char *ctype[3] = { "推", "噓", "→" @@ -2894,16 +2898,26 @@ recommend(int ent, fileheader_t * fhdr, const char *direct) logIP = 1; } +#if defined(PLAY_ANGEL) && defined(BN_ANGELPRAY) && defined(ANGEL_ANONYMOUS_COMMENT) + if (HasUserPerm(PERM_ANGEL) && currboard && strcmp(currboard, BN_ANGELPRAY) == 0 && + getans("要使用小天使暱名推文嗎? [Y/n]: ") != 'n') + { + // angel push + mynick[0] = 0; + angel_load_my_fullnick(mynick, sizeof(mynick)); + myid = mynick; + } +#endif + #ifdef OLDRECOMMEND maxlength -= 2; /* '推' */ - maxlength -= strlen(cuser.userid); - sprintf(buf, "%s %s:", "→" , cuser.userid); + maxlength -= strlen(myid); + sprintf(buf, "%s %s:", "→" , myid); #else // !OLDRECOMMEND - maxlength -= strlen(cuser.userid); + maxlength -= strlen(myid); sprintf(buf, "%s%s%s %s:", - ctype_attr[type], ctype[type], ANSI_RESET, - cuser.userid); + ctype_attr[type], ctype[type], ANSI_RESET, myid); #endif // !OLDRECOMMEND move(b_lines, 0); @@ -2966,12 +2980,12 @@ recommend(int ent, fileheader_t * fhdr, const char *direct) ANSI_COLOR(1;31) "→ " ANSI_COLOR(33) "%s" ANSI_RESET ANSI_COLOR(33) ":%-*s" ANSI_RESET "推%s\n", - cuser.userid, maxlength, msg, tail); + myid, maxlength, msg, tail); #else snprintf(buf, sizeof(buf), "%s%s " ANSI_COLOR(33) "%s" ANSI_RESET ANSI_COLOR(33) ":%-*s" ANSI_RESET "%s\n", - ctype_attr2[type], ctype[type], cuser.userid, + ctype_attr2[type], ctype[type], myid, maxlength, msg, tail); #endif // OLDRECOMMEND } |