diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-06-28 21:53:40 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-06-28 21:53:40 +0800 |
commit | 626083aaf4aab32a54f541dc5007e823082e0427 (patch) | |
tree | c34664a304778796992ac1b6ba1a0d9eef7bfe80 | |
parent | df3596513c5ccfc7851c97591075faf63cb3c24f (diff) | |
download | pttbbs-626083aaf4aab32a54f541dc5007e823082e0427.tar pttbbs-626083aaf4aab32a54f541dc5007e823082e0427.tar.gz pttbbs-626083aaf4aab32a54f541dc5007e823082e0427.tar.bz2 pttbbs-626083aaf4aab32a54f541dc5007e823082e0427.tar.lz pttbbs-626083aaf4aab32a54f541dc5007e823082e0427.tar.xz pttbbs-626083aaf4aab32a54f541dc5007e823082e0427.tar.zst pttbbs-626083aaf4aab32a54f541dc5007e823082e0427.zip |
* code refine
* change the default value for using 'boo' in 'no_boo' from 'good' to 'comment (arrow)'.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4712 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd/bbs.c | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index 68c27ebb..80eeb0aa 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -17,11 +17,18 @@ static int view_postinfo(int ent, const fileheader_t * fhdr, const char *direct, static int bnote_lastbid = -1; // 決定是否要顯示進板畫面的 cache +// recommend/comment types +// most people use recommendation just for one-line reply. +// so we may change default to (RECTYPE_ARROW)= comment only. +// however, the traditional behavior (which does not have +// BRC info for 'new comments available') uses RECTYPE_GOOD. enum { RECTYPE_GOOD, RECTYPE_BAD, RECTYPE_ARROW, - RECTYPE_MAX=RECTYPE_ARROW, + + RECTYPE_MAX = RECTYPE_ARROW, + RECTYPE_DEFAULT = RECTYPE_GOOD, // match traditional user behavior }; #ifdef ASSESS @@ -2874,12 +2881,6 @@ recommend(int ent, fileheader_t * fhdr, const char *direct) #ifndef OLDRECOMMEND else { - /* most people use recommendation just for one-line reply. - * so we change default to (RECTYPE_ARROW)= comment only now. -#define RECOMMEND_DEFAULT_VALUE (RECTYPE_ARROW) - */ -#define RECOMMEND_DEFAULT_VALUE (RECTYPE_GOOD) /* current user behavior */ - move(b_lines, 0); clrtoeol(); outs(ANSI_COLOR(1) "您覺得這篇文章 "); @@ -2895,13 +2896,23 @@ recommend(int ent, fileheader_t * fhdr, const char *direct) prints("%s3.%s " ANSI_RESET "[%d]? ", ctype_attr[2], ctype_long[2], - RECOMMEND_DEFAULT_VALUE+1); + RECTYPE_DEFAULT+1); + + type = igetch(); + + if (!isascii(type) || !isdigit(type)) + { + type = RECTYPE_DEFAULT; + } else { + type -= '1'; + if (type < 0 || type > RECTYPE_MAX) + type = RECTYPE_DEFAULT; + } - type = igetch() - '1'; if( (bp->brdattr & BRD_NOBOO) && (type == RECTYPE_BAD)) - type = RECOMMEND_DEFAULT_VALUE; - if(type < 0 || type > RECTYPE_MAX) - type = RECOMMEND_DEFAULT_VALUE; + type = RECTYPE_ARROW; + assert(type >= 0 && type <= RECTYPE_MAX); + move(b_lines, 0); clrtoeol(); } #endif |