From: Wilfried Göesgens Date: Sat, 27 Feb 2010 12:19:27 +0000 (+0000) Subject: * ups. don't need the switch anymore X-Git-Tag: v7.86~370 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=45ba7e120ee5eb37eb2b6dcb20f813df251bbadb;p=citadel.git * ups. don't need the switch anymore --- diff --git a/webcit/roomops.c b/webcit/roomops.c index 761b43956..25bb94e9b 100644 --- a/webcit/roomops.c +++ b/webcit/roomops.c @@ -3195,34 +3195,11 @@ int ConditionalHaveRoomeditRights(StrBuf *Target, WCTemplputParams *TP) int ConditionalIsRoomtype(StrBuf *Target, WCTemplputParams *TP) { wcsession *WCC = WC; - int whichtype; if ((WCC == NULL) || (TP->Tokens->nParameters < 3)) return 0; - whichtype = GetTemplateTokenNumber(Target, TP, 2, VIEW_BBS); - switch(WCC->CurRoom.view) { - case VIEW_BBS: - return whichtype == VIEW_BBS; - case VIEW_MAILBOX: - return whichtype == VIEW_MAILBOX; - case VIEW_ADDRESSBOOK: - return whichtype == VIEW_ADDRESSBOOK; - case VIEW_TASKS: - return whichtype == VIEW_TASKS; - case VIEW_NOTES: - return whichtype == VIEW_NOTES; - case VIEW_WIKI: - return whichtype == VIEW_WIKI; - case VIEW_JOURNAL: - return whichtype == VIEW_JOURNAL; - case VIEW_CALENDAR: - return whichtype == VIEW_CALENDAR; - case VIEW_CALBRIEF: - return whichtype == VIEW_CALBRIEF; - default: - return 0; - } + return WCC->CurRoom.view == GetTemplateTokenNumber(Target, TP, 2, VIEW_BBS); } void