summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2013-01-07 21:10:54 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2013-01-07 21:10:54 +0800
commit74de7f5fe9c79e1661e8d075c5ab2d90889a864c (patch)
treeed2d2e6eecde2994047b1399405eaa0cb4ec2995
parentf514511a7b67abb57090142b33e7b1aa89263e67 (diff)
downloadpttbbs-74de7f5fe9c79e1661e8d075c5ab2d90889a864c.tar
pttbbs-74de7f5fe9c79e1661e8d075c5ab2d90889a864c.tar.gz
pttbbs-74de7f5fe9c79e1661e8d075c5ab2d90889a864c.tar.bz2
pttbbs-74de7f5fe9c79e1661e8d075c5ab2d90889a864c.tar.lz
pttbbs-74de7f5fe9c79e1661e8d075c5ab2d90889a864c.tar.xz
pttbbs-74de7f5fe9c79e1661e8d075c5ab2d90889a864c.tar.zst
pttbbs-74de7f5fe9c79e1661e8d075c5ab2d90889a864c.zip
Remove calendar view once it's disabled.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5763 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/mbbsd/user.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/pttbbs/mbbsd/user.c b/pttbbs/mbbsd/user.c
index 34b909e7..7f917eb3 100644
--- a/pttbbs/mbbsd/user.c
+++ b/pttbbs/mbbsd/user.c
@@ -68,6 +68,7 @@ u_loginview(void)
{
int i, in;
unsigned int pbits = cuser.loginview;
+ int ical = -1, has_cal = 0;
do {
vs_hdr("設定進站畫面");
@@ -76,13 +77,24 @@ u_loginview(void)
// ignore those without file name
if (!*loginview_file[i][0])
continue;
+ if (strcasecmp(loginview_file[i][0], "@calendar") == 0) {
+ ical = i;
+ has_cal = pbits & (1 << ical);
+ if (!has_cal)
+ continue;
+ }
prints(" %c. %-20s %-15s \n", 'A' + i,
- loginview_file[i][1], ((pbits >> i) & 1 ? "ˇ" : "X"));
+ loginview_file[i][1], ((pbits >> i) & 1 ? "ˇ" : "X"));
}
+ // XXX calendar must be last item.
+ if (i == ical + 1 && !has_cal)
+ i--;
+
in = i; // max i
i = vmsgf("請按 [A-%c] 切換設定,按 [Return] 結束:", 'A'+in-1);
if (i == '\r')
break;
+
// process i
i = tolower(i) - 'a';
if (i >= in || i < 0 || !*loginview_file[i][0]) {