From: Wilfried Goesgens Date: Mon, 13 Sep 2010 21:47:24 +0000 (+0200) Subject: * knrooms(): X-Git-Tag: v8.01~715 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=f7fa2cb3c9eee3efa7b685ba0dcf04882a743c0a * knrooms(): - use the right values for the type of display - detect properly whether we need to set a default --- diff --git a/webcit/roomops.c b/webcit/roomops.c index 9da586382..8aed0e6f6 100644 --- a/webcit/roomops.c +++ b/webcit/roomops.c @@ -1105,22 +1105,16 @@ void knrooms(void) set_preference("roomlistview", ListView, 1); } /** Sanitize the input so its safe */ - if((get_preference("roomlistview", &ListView) != 0)|| - ((strcasecmp(ChrPtr(ListView), "folders") != 0) && - (strcasecmp(ChrPtr(ListView), "table") != 0))) + if ((get_preference("roomlistview", &ListView) == 0)|| + ( + (strcasecmp(ChrPtr(ListView), "folders") != 0) && + (strcasecmp(ChrPtr(ListView), "rooms") != 0) + ) + ) { - if (ListView == NULL) { - ListView = NewStrBufPlain(HKEY("rooms")); - set_preference("roomlistview", ListView, 0); - ListView = NULL; - } - else { - ListView = NewStrBufPlain(HKEY("rooms")); - set_preference("roomlistview", ListView, 0); - ListView = NULL; - } + ListView = NewStrBufPlain(HKEY("rooms")); + set_preference("roomlistview", ListView, 0); } - FreeStrBuf(&ListView); url_do_template(); }