diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-07-06 14:06:02 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-07-06 14:06:02 +0800 |
commit | ecdf6203e40698b62611c1099bb010cdd5924924 (patch) | |
tree | 66425bf8800a3ea38a8d18635d8c4f8ad210f2cc /mbbsd | |
parent | 067faff5d4aa230c86320393d03d8eb1d4303f7a (diff) | |
download | pttbbs-ecdf6203e40698b62611c1099bb010cdd5924924.tar pttbbs-ecdf6203e40698b62611c1099bb010cdd5924924.tar.gz pttbbs-ecdf6203e40698b62611c1099bb010cdd5924924.tar.bz2 pttbbs-ecdf6203e40698b62611c1099bb010cdd5924924.tar.lz pttbbs-ecdf6203e40698b62611c1099bb010cdd5924924.tar.xz pttbbs-ecdf6203e40698b62611c1099bb010cdd5924924.tar.zst pttbbs-ecdf6203e40698b62611c1099bb010cdd5924924.zip |
help update, fix mail title unchanged outside vedit (partial?)
and 'search for recommends' patch by ledia@ptt, thanks.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2903 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/mail.c | 3 | ||||
-rw-r--r-- | mbbsd/read.c | 37 |
2 files changed, 28 insertions, 12 deletions
diff --git a/mbbsd/mail.c b/mbbsd/mail.c index 5e9be2fe..e0195689 100644 --- a/mbbsd/mail.c +++ b/mbbsd/mail.c @@ -316,12 +316,13 @@ do_send(const char *userid, const char *title) sethomepath(genbuf, userid); stampfile(genbuf, &mhdr); strlcpy(mhdr.owner, cuser.userid, sizeof(mhdr.owner)); - strncpy(mhdr.title, save_title, TTLEN); if (vedit(genbuf, YEA, NULL) == -1) { unlink(genbuf); clear(); return -2; } + /* why not make title here? */ + strncpy(mhdr.title, save_title, TTLEN); clear(); sethomefile(fpath, userid, FN_OVERRIDES); i = belong(fpath, cuser.userid); diff --git a/mbbsd/read.c b/mbbsd/read.c index 6f10aa25..ca62d426 100644 --- a/mbbsd/read.c +++ b/mbbsd/read.c @@ -394,7 +394,7 @@ select_read(const keeploc_t * locmem, int sr_mode) char keyword[TTLEN + 1] = ""; char genbuf[MAXPATHLEN], *p = strstr(currdirect, "SR."); static int _mode = 0; - int len, fd, fr, i, count=0, reference = 0; + int len, fd, fr, i, count=0, reference = 0, n_recommend = 0; fileheader_t *fh = &headers[locmem->crs_ln - locmem->top_ln]; STATINC(STAT_SELECTREAD); @@ -416,14 +416,22 @@ select_read(const keeploc_t * locmem, int sr_mode) "%s:%s\n", currboard, keyword); #endif } - else if(sr_mode & RS_NOKEYWORD) + else if(sr_mode & RS_KEYWORD_EXCLUDE) { if(!(currmode & MODE_SELECT) || !getdata(b_lines, 0, "增加條件 排除標題:", keyword, TTLEN, DOECHO)) return READ_REDRAW; } - else + else if (sr_mode & RS_RECOMMEND) + { + if(currstat != RMAIL && ( + !getdata(b_lines, 0, + (currmode & MODE_SELECT) ? "增加條件 推文數:":"最低推數:", + keyword, 7, LCECHO) || (n_recommend = atoi(keyword)) <= 0 )) + return READ_REDRAW; + } + else { if(p && _mode & sr_mode & (RS_TITLE | RS_NEWPOST | RS_MARK)) return DONOTHING; @@ -458,24 +466,27 @@ select_read(const keeploc_t * locmem, int sr_mode) len /= sizeof(fileheader_t); for( i = 0 ; i < len ; ++i ){ reference++; - if( sr_mode & RS_MARK && + if( (sr_mode & RS_MARK) && !(fhs[i].filemode & FILE_MARKED) ) continue; - else if(sr_mode & RS_NEWPOST && + else if((sr_mode & RS_NEWPOST) && !strncmp(fhs[i].title, "Re:", 3)) continue; - else if(sr_mode & RS_AUTHOR && + else if((sr_mode & RS_AUTHOR) && !strcasestr(fhs[i].owner, keyword)) continue; - else if(sr_mode & RS_KEYWORD && + else if((sr_mode & RS_KEYWORD) && !strcasestr(fhs[i].title, keyword)) continue; - else if(sr_mode & RS_NOKEYWORD && + else if(sr_mode & RS_KEYWORD_EXCLUDE && strcasestr(fhs[i].title, keyword)) continue; - else if(sr_mode & RS_TITLE && + else if((sr_mode & RS_TITLE) && strcmp(subject(fhs[i].title), keyword)) continue; + else if ((sr_mode & RS_RECOMMEND) && + fhs[i].recommend < n_recommend ) + continue; ++count; if(p == NULL) { @@ -555,7 +566,11 @@ i_read_key(const onekey_t * rcmdlist, keeploc_t * locmem, case Ctrl('H'): mode = select_read(locmem, RS_NEWPOST); break; - + + case 'Z': + mode = select_read(locmem, RS_RECOMMEND); + break; + case 'a': case 'A': mode = select_read(locmem, RS_AUTHOR); @@ -575,7 +590,7 @@ i_read_key(const onekey_t * rcmdlist, keeploc_t * locmem, break; case '!': - mode = select_read(locmem, RS_NOKEYWORD); + mode = select_read(locmem, RS_KEYWORD_EXCLUDE); break; case '=': |