X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Froomops.c;h=6fb8bafb43814103dba002f8bc4034e6c22040ab;hb=5ff52be939c2a41fcb0296df76e34a477c3a2576;hp=a7993a062c07407f5286988525cba843fd3b0785;hpb=10a92e8454f075950ca5de5dcec753266fd8c16b;p=citadel.git diff --git a/webcit/roomops.c b/webcit/roomops.c index a7993a062..6fb8bafb4 100644 --- a/webcit/roomops.c +++ b/webcit/roomops.c @@ -1,19 +1,17 @@ /* * $Id$ + * Lots of different room-related operations. */ -/** - * \defgroup RoomOps Lots of different room-related operations. - * \ingroup CitadelCommunitacion - */ -/*@{*/ -#include "webcit.h" -char floorlist[128][SIZ]; /**< list of our floor names */ +#include "webcit.h" +#include "webserver.h" +#define MAX_FLOORS 128 +char floorlist[MAX_FLOORS][SIZ]; /**< list of our floor names */ -char *viewdefs[8]; /**< the different kinds of available views */ +char *viewdefs[9]; /**< the different kinds of available views */ -/** - * \brief initialize the viewdefs with localized strings +/* + * Initialize the viewdefs with localized strings */ void initialize_viewdefs(void) { viewdefs[0] = _("Bulletin Board"); @@ -24,12 +22,11 @@ void initialize_viewdefs(void) { viewdefs[5] = _("Notes List"); viewdefs[6] = _("Wiki"); viewdefs[7] = _("Calendar List"); + viewdefs[8] = _("Journal"); } -/** - * \brief Determine which views are allowed as the default for creating a new room. - * - * \param which_view The view ID being queried. +/* + * Determine which views are allowed as the default for creating a new room. */ int is_view_allowed_as_default(int which_view) { @@ -40,22 +37,29 @@ int is_view_allowed_as_default(int which_view) case VIEW_CALENDAR: return(1); case VIEW_TASKS: return(1); case VIEW_NOTES: return(1); - case VIEW_WIKI: return(0); /**< because it isn't finished yet */ + +#ifdef TECH_PREVIEW + case VIEW_WIKI: return(1); +#else /* TECH_PREVIEW */ + case VIEW_WIKI: return(0); /* because it isn't finished yet */ +#endif /* TECH_PREVIEW */ + case VIEW_CALBRIEF: return(0); - default: return(0); /**< should never get here */ + case VIEW_JOURNAL: return(0); + default: return(0); /* should never get here */ } } -/** - * \brief load the list of floors +/* + * load the list of floors */ void load_floorlist(void) { int a; char buf[SIZ]; - for (a = 0; a < 128; ++a) + for (a = 0; a < MAX_FLOORS; ++a) floorlist[a][0] = 0; serv_puts("LFLR"); @@ -70,10 +74,8 @@ void load_floorlist(void) } -/** - * \brief Free a session's march list - * - * \param wcf Pointer to session being cleared +/* + * Free a session's march list */ void free_march_list(struct wcsession *wcf) { @@ -89,8 +91,8 @@ void free_march_list(struct wcsession *wcf) -/** - * \brief remove a room from the march list +/* + * remove a room from the march list */ void remove_march(char *aaa) { @@ -120,9 +122,8 @@ void remove_march(char *aaa) -/** - * \brief display rooms in tree structure??? - * \param rp the roomlist to build a tree from +/* + * display rooms in tree structure */ void room_tree_list(struct roomlisting *rp) { @@ -151,7 +152,7 @@ void room_tree_list(struct roomlisting *rp) wprintf(")"); else wprintf(">"); - wprintf(" \n"); + wprintf(" \n"); room_tree_list(rp->rnext); free(rp); @@ -197,7 +198,6 @@ void listrms(char *variety) struct roomlisting *rp; struct roomlisting *rs; - /** Ask the server for a room list */ serv_puts(variety); serv_getln(buf, sizeof buf); @@ -205,6 +205,7 @@ void listrms(char *variety) wprintf(" "); return; } + while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) { ++num_rooms; rp = malloc(sizeof(struct roomlisting)); @@ -253,9 +254,9 @@ void listrms(char *variety) */ void zapped_list(void) { - output_headers(1, 1, 0, 0, 0, 0); + output_headers(1, 1, 1, 0, 0, 0); - svprintf("BOXTITLE", WCS_STRING, _("Zapped (forgotten) rooms")); + svput("BOXTITLE", WCS_STRING, _("Zapped (forgotten) rooms")); do_template("beginbox"); listrms("LZRM -1"); @@ -272,12 +273,37 @@ void zapped_list(void) */ void readinfo(void) { - char buf[SIZ]; + char buf[256]; + char briefinfo[128]; + char fullinfo[8192]; + int fullinfo_len = 0; serv_puts("RINF"); serv_getln(buf, sizeof buf); if (buf[0] == '1') { - fmout("CENTER"); + + while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) { + if (fullinfo_len < (sizeof fullinfo - sizeof buf)) { + strcpy(&fullinfo[fullinfo_len], buf); + fullinfo_len += strlen(buf); + } + } + + safestrncpy(briefinfo, fullinfo, sizeof briefinfo); + strcpy(&briefinfo[50], "..."); + + wprintf("