From febd5afc508c5776a11a8fd382da8e235bc0ebe3 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 14 Jan 2003 04:21:27 +0000 Subject: [PATCH] * Only offer views which make sense for the default view of a room --- webcit/ChangeLog | 4 ++++ webcit/README.txt | 2 +- webcit/roomops.c | 24 +++++++++++++++++++----- webcit/webcit.h | 1 + 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/webcit/ChangeLog b/webcit/ChangeLog index 2a0784d76..d3a6a1538 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,4 +1,7 @@ $Log$ +Revision 400.83 2003/01/14 04:21:27 ajc +* Only offer views which make sense for the default view of a room + Revision 400.82 2003/01/13 03:34:33 ajc * Get ready for the 6.10 release @@ -1237,3 +1240,4 @@ Sun Dec 6 19:50:55 EST 1998 Art Cancro 1998-12-03 Nathan Bryant * webserver.c: warning fix + diff --git a/webcit/README.txt b/webcit/README.txt index de9d0da50..cec68dadd 100644 --- a/webcit/README.txt +++ b/webcit/README.txt @@ -1,7 +1,7 @@ WEBCIT for the Citadel/UX System version 4.10 - Copyright (C) 1996-2002 by the authors. Portions written by: + Copyright (C) 1996-2003 by the authors. Portions written by: Art Cancro Nathan Bryant Nick Grossman diff --git a/webcit/roomops.c b/webcit/roomops.c index 65f018071..068ab233a 100644 --- a/webcit/roomops.c +++ b/webcit/roomops.c @@ -348,11 +348,24 @@ void embed_view_o_matic(void) { "[selectedIndex].value\">\n"); for (i=0; i<(sizeof viewdefs / sizeof (char *)); ++i) { - wprintf("\n"); + /* + * Only offer the views that make sense, given the default + * view for the room. For example, don't offer a Calendar + * view in a non-Calendar room. + */ + if ( + (i == WC->wc_view) + || (i == WC->wc_default_view) + || ( (i == 0) && (WC->wc_default_view == 1) ) + || ( (i == 1) && (WC->wc_default_view == 0) ) + ) { + + wprintf("\n"); + } } wprintf("\n"); } @@ -467,6 +480,7 @@ void gotoroom(char *gname, int display_name) } strcpy(WC->wc_roomname, WC->wc_roomname); WC->wc_view = extract_int(&buf[4], 11); + WC->wc_default_view = extract_int(&buf[4], 12); } diff --git a/webcit/webcit.h b/webcit/webcit.h index 31976fc55..a4a592be3 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -160,6 +160,7 @@ struct wcsession { int serv_sock; unsigned room_flags; int wc_view; + int wc_default_view; char ugname[128]; long uglsn; int upload_length; -- 2.39.2