summaryrefslogtreecommitdiffstats
path: root/mbbsd/fav.c
diff options
context:
space:
mode:
authorvictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-01-04 19:51:50 +0800
committervictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-01-04 19:51:50 +0800
commite3d9790af8488b115475131fb928ed974604abfc (patch)
treed22419c2b93820098b1c07fc94983815dc7563a4 /mbbsd/fav.c
parent38262b22bfe8cfe1f7de6f272e18a3aae340f83a (diff)
downloadpttbbs-e3d9790af8488b115475131fb928ed974604abfc.tar
pttbbs-e3d9790af8488b115475131fb928ed974604abfc.tar.gz
pttbbs-e3d9790af8488b115475131fb928ed974604abfc.tar.bz2
pttbbs-e3d9790af8488b115475131fb928ed974604abfc.tar.lz
pttbbs-e3d9790af8488b115475131fb928ed974604abfc.tar.xz
pttbbs-e3d9790af8488b115475131fb928ed974604abfc.tar.zst
pttbbs-e3d9790af8488b115475131fb928ed974604abfc.zip
show non-visible board in fav
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1457 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/fav.c')
-rw-r--r--mbbsd/fav.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/mbbsd/fav.c b/mbbsd/fav.c
index 587dc041..338375f7 100644
--- a/mbbsd/fav.c
+++ b/mbbsd/fav.c
@@ -210,13 +210,9 @@ char current_fav_at_root(void) {
return get_current_fav() == get_fav_root();
}
-/* is it an unvisable entry */
-inline int is_visible_item(fav_type_t *ft){
- if (!(ft->attr & FAVH_FAV))
- return 0;
- if (get_item_type(ft) != FAVT_BOARD)
- return 1;
- return Ben_Perm(&bcache[cast_board(ft)->bid - 1]);
+/* is it an valid entry */
+inline int valid_item(fav_type_t *ft){
+ return ft->attr & FAVH_FAV;
}
/* return: the exact number after cleaning
@@ -235,13 +231,13 @@ static void rebuild_fav(fav_t *fp)
continue;
ft = &fp->favh[i];
switch (get_item_type(ft)){
-/*
case FAVT_BOARD:
+/*
bid = cast_board(ft)->bid;
if (SHM->GV2.e.cleanboard && bcache[bid - 1].brdname[0])
continue;
- break;
*/
+ break;
case FAVT_LINE:
cast_line(ft)->lid = fp->lineID + 1;
break;
@@ -495,7 +491,7 @@ static fav_type_t *get_fav_item(short id, int type)
for(i = 0; i < fp->DataTail; i++){
ft = &fp->favh[i];
- if (!is_visible_item(ft) || get_item_type(ft) != type)
+ if (!valid_item(ft) || get_item_type(ft) != type)
continue;
if (fav_getid(ft) == id)
return ft;
@@ -615,11 +611,11 @@ static void move_in_folder(fav_t *fav, int from, int to)
/* Find real locations of from and to in fav->favh[] */
for(count = i = 0; count <= from; i++)
- if (is_visible_item(&fav->favh[i]))
+ if (valid_item(&fav->favh[i]))
count++;
from = i - 1;
for(count = i = 0; count <= to; i++)
- if (is_visible_item(&fav->favh[i]))
+ if (valid_item(&fav->favh[i]))
count++;
to = i - 1;
@@ -800,7 +796,7 @@ static void fav_do_recursively(fav_t *fp, int (*act)(fav_t *))
fav_type_t *ft;
for(i = 0; i < fp->DataTail; i++){
ft = &fp->favh[i];
- if (!is_visible_item(ft))
+ if (!valid_item(ft))
continue;
if (get_item_type(ft) == FAVT_FOLDER && get_fav_folder(ft) != NULL){
fav_do_recursively(get_fav_folder(ft), act);