X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Froomops.c;h=aa38db4db7fb0fe0f9aef0f1dcde84b3fe27a30d;hb=44c30618e25ce2eb103b87e84e10dcd51dad0879;hp=db99379d98392e16a1804ac840fb8a27a590892a;hpb=63deece5bd2380725f32c42b5af0e74272afa140;p=citadel.git diff --git a/webcit/roomops.c b/webcit/roomops.c index db99379d9..aa38db4db 100644 --- a/webcit/roomops.c +++ b/webcit/roomops.c @@ -1,34 +1,32 @@ /* * $Id$ - * - * Lots of different room-related operations. */ - +/** + * \defgroup RoomOps Lots of different room-related operations. + */ +/*@{*/ #include "webcit.h" -struct folder { - int floor; - char room[SIZ]; - char name[SIZ]; - int hasnewmsgs; - int is_mailbox; - int selectable; - int view; -}; +char floorlist[128][SIZ]; /**< list of our floor names */ -char *viewdefs[] = { - "Bulletin Board", - "Mail Folder", - "Address Book", - "Calendar", - "Task List", - "Notes List" -}; +char *viewdefs[7]; /**< the different kinds of available views */ -char floorlist[128][SIZ]; +/** + * \brief initialize the viewdefs with localized strings + */ +void initialize_viewdefs(void) { + viewdefs[0] = _("Bulletin Board"); + viewdefs[1] = _("Mail Folder"); + viewdefs[2] = _("Address Book"); + viewdefs[3] = _("Calendar"); + viewdefs[4] = _("Task List"); + viewdefs[5] = _("Notes List"); + viewdefs[6] = _("Wiki"); +} -/* - * load the list of floors + +/** + * \brief load the list of floors */ void load_floorlist(void) { @@ -50,8 +48,8 @@ void load_floorlist(void) } -/* - * remove a room from the march list +/** + * \brief remove a room from the march list */ void remove_march(char *aaa) { @@ -81,7 +79,10 @@ void remove_march(char *aaa) - +/** + * \brief display rooms in tree structure??? + * \param rp the roomlist to build a tree from + */ void room_tree_list(struct roomlisting *rp) { char rmname[64]; @@ -116,8 +117,11 @@ void room_tree_list(struct roomlisting *rp) } -/* - * Room ordering stuff (compare first by floor, then by order) +/** + * \brief Room ordering stuff (compare first by floor, then by order) + * \param r1 first roomlist to compare + * \param r2 second roomlist co compare + * \return are they the same??? */ int rordercmp(struct roomlisting *r1, struct roomlisting *r2) { @@ -139,8 +143,9 @@ int rordercmp(struct roomlisting *r1, struct roomlisting *r2) } -/* - * Common code for all room listings +/** + * \brief Common code for all room listings + * \param variety what??? */ void listrms(char *variety) { @@ -152,7 +157,7 @@ void listrms(char *variety) struct roomlisting *rs; - /* Ask the server for a room list */ + /** Ask the server for a room list */ serv_puts(variety); serv_getln(buf, sizeof buf); if (buf[0] != '1') { @@ -194,15 +199,16 @@ void listrms(char *variety) room_tree_list(rl); - /* If no rooms were listed, print an nbsp to make the cell + /** + * If no rooms were listed, print an nbsp to make the cell * borders show up anyway. */ if (num_rooms == 0) wprintf(" "); } -/* - * list all forgotten rooms +/** + * \brief list all forgotten rooms */ void zapped_list(void) { @@ -220,8 +226,8 @@ void zapped_list(void) } -/* - * read this room's info file (set v to 1 for verbose mode) +/** + * \brief read this room's info file (set v to 1 for verbose mode) */ void readinfo(void) { @@ -232,12 +238,17 @@ void readinfo(void) if (buf[0] == '1') { fmout("CENTER"); } + else { + wprintf(" "); + } } -/* Display room banner icon. The server doesn't actually +/** + * \brief Display room banner icon. + * The server doesn't actually * need the room name, but we supply it in order to * keep the browser from using a cached icon from * another room. @@ -295,14 +306,16 @@ void embed_room_graphic(void) { -/* - * Display the current view and offer an option to change it +/** + * \brief Display the current view and offer an option to change it */ void embed_view_o_matic(void) { int i; wprintf("
\n" - "View as: " + ""); + wprintf(_("View as:")); + wprintf(" " "\n"); - /* end of directory stuff */ + /** end of directory stuff */ wprintf("
  • "); wprintf(_("Permanent (does not auto-purge)")); - /* start of anon options */ + /** start of anon options */ wprintf("\n
  • "); wprintf(_("Anonymous messages")); @@ -1171,13 +1215,13 @@ void display_editroom(void) } - /* Sharing the room with other Citadel nodes... */ + /** Sharing the room with other Citadel nodes... */ if (!strcmp(tab, "sharing")) { shared_with = strdup(""); not_shared_with = strdup(""); - /* Learn the current configuration */ + /** Learn the current configuration */ serv_puts("CONF getsys|application/x-citadel-ignet-config"); serv_getln(buf, sizeof buf); if (buf[0]=='1') while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) { @@ -1217,7 +1261,7 @@ void display_editroom(void) } } - /* Display the stuff */ + /** Display the stuff */ wprintf("

    " "" "
    "); @@ -1326,7 +1370,7 @@ void display_editroom(void) } - /* Mailing list management */ + /** Mailing list management */ if (!strcmp(tab, "listserv")) { wprintf("
    " @@ -1418,7 +1462,7 @@ void display_editroom(void) } - /* Mailing list management */ + /** Mailing list management */ if (!strcmp(tab, "expire")) { serv_puts("GPEX room"); @@ -1452,7 +1496,8 @@ void display_editroom(void) wprintf("
    \n"); wprintf("", ((roompolicy == 2) ? "CHECKED" : "") ); - wprintf("Expire by message count
    \n"); + wprintf(_("Expire by message count")); + wprintf("
    \n"); wprintf("", ((roompolicy == 3) ? "CHECKED" : "") ); wprintf(_("Expire by message age")); @@ -1503,20 +1548,20 @@ void display_editroom(void) } - /* Mailing list management */ + /** Mailing list management */ if (!strcmp(tab, "access")) { display_whok(); } - /* end content of whatever tab is open now */ + /** end content of whatever tab is open now */ wprintf("
    \n"); wDumpContent(1); } -/* - * Toggle self-service list subscription +/** + * \brief Toggle self-service list subscription */ void toggle_self_service(void) { int newval = 0; @@ -1528,8 +1573,8 @@ void toggle_self_service(void) { -/* - * save new parameters for a room +/** + * \brief save new parameters for a room */ void editroom(void) { @@ -1690,8 +1735,8 @@ void editroom(void) } -/* - * Display form for Invite, Kick, and show Who Knows a room +/** + * \brief Display form for Invite, Kick, and show Who Knows a room */ void do_invt_kick(void) { char buf[SIZ], room[SIZ], username[SIZ]; @@ -1740,8 +1785,8 @@ void do_invt_kick(void) { -/* - * Display form for Invite, Kick, and show Who Knows a room +/** + * \brief Display form for Invite, Kick, and show Who Knows a room */ void display_whok(void) { @@ -1788,7 +1833,8 @@ void display_whok(void) wprintf("
    \n"); wprintf("\n"); - wprintf("Invite: "); + wprintf(_("Invite:")); + wprintf(" "); wprintf("
    \n" "" "" @@ -1800,8 +1846,8 @@ void display_whok(void) -/* - * display the form for entering a new room +/** + * \brief display the form for entering a new room */ void display_entroom(void) { @@ -1827,7 +1873,7 @@ void display_entroom(void) "\n
    \n" ); - wprintf("
    " + wprintf("
    " "
    \n"); wprintf("\n"); @@ -1849,15 +1895,17 @@ void display_entroom(void) } wprintf("\n"); - /* Our clever little snippet of JavaScript automatically selects - * a public room if the view is set to Bulletin Board, and it - * selects a mailbox room otherwise. The user can override this, - * of course. - */ - wprintf("
  • "); - wprintf(_("Default view for room: ")); + /** + * Our clever little snippet of JavaScript automatically selects + * a public room if the view is set to Bulletin Board or wiki, and + * it selects a mailbox room otherwise. The user can override this, + * of course. We also disable the floor selector for mailboxes. + */ + wprintf("
  • "); + wprintf(_("Default view for room: ")); wprintf("
    \n"); wprintf("
    \n"); @@ -2077,8 +2125,8 @@ void display_private(char *rname, int req_pass) wDumpContent(1); } -/* - * goto a private room +/** + * \brief goto a private room */ void goto_private(void) { @@ -2112,8 +2160,8 @@ void goto_private(void) } -/* - * display the screen to zap a room +/** + * \brief display the screen to zap a room */ void display_zap(void) { @@ -2140,15 +2188,16 @@ void display_zap(void) } -/* - * zap a room +/** + * \brief zap a room */ void zap(void) { char buf[SIZ]; char final_destination[SIZ]; - /* If the forget-room routine fails for any reason, we fall back + /** + * If the forget-room routine fails for any reason, we fall back * to the current room; otherwise, we go to the Lobby */ strcpy(final_destination, WC->wc_roomname); @@ -2169,8 +2218,8 @@ void zap(void) -/* - * Delete the current room +/** + * \brief Delete the current room */ void delete_room(void) { @@ -2189,8 +2238,8 @@ void delete_room(void) -/* - * Perform changes to a room's network configuration +/** + * \brief Perform changes to a room's network configuration */ void netedit(void) { FILE *fp; @@ -2224,7 +2273,7 @@ void netedit(void) { return; } - /* This loop works for add *or* remove. Spiffy, eh? */ + /** This loop works for add *or* remove. Spiffy, eh? */ while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) { extract_token(cmpa0, buf, 0, '|', sizeof cmpa0); extract_token(cmpa1, buf, 1, '|', sizeof cmpa1); @@ -2261,28 +2310,32 @@ void netedit(void) { -/* - * Convert a room name to a folder-ish-looking name. +/** + * \brief Convert a room name to a folder-ish-looking name. + * \param folder the folderish name + * \param room the room name + * \param floor the floor name + * \param is_mailbox is it a mailbox? */ void room_to_folder(char *folder, char *room, int floor, int is_mailbox) { int i; - /* + /** * For mailboxes, just do it straight... */ if (is_mailbox) { sprintf(folder, "My folders|%s", room); } - /* + /** * Otherwise, prefix the floor name as a "public folders" moniker */ else { sprintf(folder, "%s|%s", floorlist[floor], room); } - /* + /** * Replace "\" characters with "|" for pseudo-folder-delimiting */ for (i=0; iLoading folder list...\n"); - /* include NanoTree */ + /** include NanoTree */ wprintf("\n"); - /* initialize NanoTree */ + /** initialize NanoTree */ wprintf("