X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Froomops.c;h=aa38db4db7fb0fe0f9aef0f1dcde84b3fe27a30d;hb=44c30618e25ce2eb103b87e84e10dcd51dad0879;hp=bee25dd2a7fa38ab6df96e11eac25d88f55063a8;hpb=eb5cdfb4706f648eadc11e71ea5c7c94e751fe11;p=citadel.git diff --git a/webcit/roomops.c b/webcit/roomops.c index bee25dd2a..aa38db4db 100644 --- a/webcit/roomops.c +++ b/webcit/roomops.c @@ -1,53 +1,32 @@ /* * $Id$ - * - * Lots of different room-related operations. */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +/** + * \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[7]; /**< the different kinds of available views */ -char *viewdefs[] = { - "Bulletin Board", - "Mail Folder", - "Address Book", - "Calendar", - "Task List", - "Notes List" -}; +/** + * \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"); +} -char floorlist[128][SIZ]; -/* - * load the list of floors +/** + * \brief load the list of floors */ void load_floorlist(void) { @@ -69,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) { @@ -100,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]; @@ -115,7 +97,7 @@ void room_tree_list(struct roomlisting *rp) strcpy(rmname, rp->rlname); f = rp->rlflags; - wprintf(""); @@ -135,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) { @@ -158,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) { @@ -171,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') { @@ -213,34 +199,35 @@ 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) { - output_headers(1, 1, 0, 0, 0, 0, 0); + output_headers(1, 1, 0, 0, 0, 0); - svprintf("BOXTITLE", WCS_STRING, "Zapped (forgotten) rooms"); + svprintf("BOXTITLE", WCS_STRING, _("Zapped (forgotten) rooms")); do_template("beginbox"); listrms("LZRM -1"); wprintf("

\n"); - wprintf("Click on any room to un-zap it and goto that room.\n"); + wprintf(_("Click on any room to un-zap it and goto that room.\n")); do_template("endbox"); wDumpContent(1); } -/* - * 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) { @@ -249,14 +236,19 @@ void readinfo(void) serv_puts("RINF"); serv_getln(buf, sizeof buf); if (buf[0] == '1') { - fmout(NULL, "CENTER"); + 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. @@ -267,7 +259,7 @@ void embed_room_graphic(void) { serv_puts("OIMG _roompic_"); serv_getln(buf, sizeof buf); if (buf[0] == '2') { - wprintf("wc_roomname); wprintf("\">"); serv_puts("CLOS"); @@ -313,30 +305,17 @@ void embed_room_graphic(void) { } -/* Let the user know if new mail has arrived - */ -void embed_newmail_button(void) { - if ( (WC->new_mail > WC->remember_new_mail) && (WC->new_mail>0) ) { - wprintf( - "
" - "" - "
" - "%d new mail
", WC->new_mail); - WC->remember_new_mail = WC->new_mail; - } -} - - -/* - * 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("\n" + ""); + wprintf(_("View as:")); + wprintf(" " "\n", er_name); + wprintf("
  • "); + wprintf(_("Name of room: ")); + wprintf("\n", + er_name, + (sizeof(er_name)-1) + ); - wprintf("
  • Resides on floor: "); + wprintf("
  • "); + wprintf(_("Resides on floor: ")); wprintf("\n"); - wprintf("
  • Type of room:
      \n"); + wprintf("
    • "); + wprintf(_("Type of room:")); + wprintf("
        \n"); wprintf("
      • Public room\n"); + wprintf("> "); + wprintf(_("Public room")); + wprintf("\n"); wprintf("
      • Private - guess name\n"); + wprintf("> "); + wprintf(_("Private - guess name")); - wprintf("
      • Private - require password:\n"); - wprintf("\n", er_password); + wprintf("> "); + wprintf(_("Private - require password:")); + wprintf("\n\n", + er_password); wprintf("
      • Private - invitation only\n"); + wprintf("> "); + wprintf(_("Private - invitation only")); - wprintf("
      • If private, cause current users to forget room\n"); + wprintf("\n
      • "); + wprintf(_("If private, cause current users to forget room")); - wprintf("
      \n"); + wprintf("\n
    \n"); wprintf("
  • Preferred users only\n"); + wprintf("> "); + wprintf(_("Preferred users only")); - wprintf("
  • Read-only room\n"); + wprintf("> "); + wprintf(_("Read-only room")); - /* directory stuff */ - wprintf("
  • File directory room\n"); + wprintf("> "); + wprintf(_("File directory room")); - wprintf("
    • Directory name: "); - wprintf("\n", er_dirname); + wprintf("\n
      • "); + wprintf(_("Directory name: ")); + wprintf("\n", + er_dirname); wprintf("
      • Uploading allowed\n"); + wprintf("> "); + wprintf(_("Uploading allowed")); - wprintf("
      • Downloading allowed\n"); + wprintf("> "); + wprintf(_("Downloading allowed")); - wprintf("
      • Visible directory
      \n"); + wprintf("> "); + wprintf(_("Visible directory")); + wprintf("
    \n"); - /* end of directory stuff */ + /** end of directory stuff */ wprintf("
  • Network shared room\n"); + wprintf("> "); + wprintf(_("Network shared room")); - wprintf("
  • Permanent (does not auto-purge)\n"); + wprintf("> "); + wprintf(_("Permanent (does not auto-purge)")); - /* start of anon options */ + /** start of anon options */ - wprintf("
  • Anonymous messages
      \n"); + wprintf("\n
    • "); + wprintf(_("Anonymous messages")); + wprintf("
        \n"); wprintf("
      • No anonymous messages\n"); + wprintf("> "); + wprintf(_("No anonymous messages")); - wprintf("
      • All messages are anonymous\n"); + wprintf("> "); + wprintf(_("All messages are anonymous")); - wprintf("
      • Prompt user when entering messages
      \n"); + wprintf("> "); + wprintf(_("Prompt user when entering messages")); + wprintf("
    \n"); /* end of anon options */ - wprintf("
  • Room aide: \n"); + wprintf("
  • "); + wprintf(_("Room aide: ")); serv_puts("GETA"); serv_getln(buf, sizeof buf); if (buf[0] != '2') { @@ -1147,21 +1205,23 @@ void display_editroom(void) wprintf("
\n"); wprintf("\n" - "" + "" " " - "" - "
\n" + "" + "\n", + _("Save changes"), + _("Cancel") ); } - /* 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")) { @@ -1201,19 +1261,24 @@ void display_editroom(void) } } - /* Display the stuff */ + /** Display the stuff */ wprintf("

" "" - "" - "\n" + "" + "\n" "" "
Shared withNot shared with
"); + wprintf(_("Shared with")); + wprintf(""); + wprintf(_("Not shared with")); + wprintf("
\n"); - wprintf("" - "" - "" - "" - "\n" - ); + wprintf("
Remote node nameRemote room nameActions
\n"); for (i=0; i 0) { wprintf("" + "action=\"netedit\">" "\n", node); wprintf("\n"); } } wprintf("
"); + wprintf(_("Remote node name")); + wprintf(""); + wprintf(_("Remote room name")); + wprintf(""); + wprintf(_("Actions")); + wprintf("
%s"); @@ -1245,25 +1310,26 @@ void display_editroom(void) wprintf("\n"); wprintf(""); + "NAME=\"unshare_button\" VALUE=\"%s\">", _("Unshare")); wprintf("
\n"); wprintf("
\n"); - wprintf("" - "" - "" - "" - "\n" - ); + wprintf("
Remote node nameRemote room nameActions
\n"); for (i=0; i 0) { wprintf("
" + "action=\"netedit\">" "
\n"); } } @@ -1289,31 +1355,32 @@ void display_editroom(void) wprintf("
"); + wprintf(_("Remote node name")); + wprintf(""); + wprintf(_("Remote room name")); + wprintf(""); + wprintf(_("Actions")); + wprintf("
"); escputs(node); wprintf("" @@ -1281,7 +1347,7 @@ void display_editroom(void) wprintf("\n"); wprintf(""); + "NAME=\"add_button\" VALUE=\"%s\">", _("Share")); wprintf("
\n"); wprintf("

\n" - "Notes:
  • When sharing a room, " + "%s
    • ", _("Notes:")); + wprintf(_("When sharing a room, " "it must be shared from both ends. Adding a node to " "the 'shared' list sends messages out, but in order to" " receive messages, the other nodes must be configured" - " to send messages out to your system as well.\n" + " to send messages out to your system as well. " "
    • If the remote room name is blank, it is assumed " "that the room name is identical on the remote node." "
    • If the remote room name is different, the remote " "node must also configure the name of the room here." "

    \n" - ); + )); } - /* Mailing list management */ + /** Mailing list management */ if (!strcmp(tab, "listserv")) { wprintf("
    " "" "
    "); - wprintf("The contents of this room are being " + wprintf(_("The contents of this room are being " "mailed as individual messages " "to the following list recipients:" - "

    \n"); + "


    \n")); serv_puts("GNET"); serv_getln(buf, sizeof buf); @@ -1323,26 +1390,27 @@ void display_editroom(void) extract_token(recp, buf, 1, '|', sizeof recp); escputs(recp); - wprintf(" (remove)
    "); - + wprintf("&tab=listserv\">"); + wprintf(_("(remove)")); + wprintf("
    "); } } - wprintf("
    \n" + wprintf("
    \n" "\n" "\n"); wprintf("\n"); - wprintf(""); + wprintf("", _("Add")); wprintf("
    \n"); wprintf("
    \n"); - wprintf("The contents of this room are being " + wprintf(_("The contents of this room are being " "mailed in digest form " "to the following list recipients:" - "

    \n"); + "


    \n")); serv_puts("GNET"); serv_getln(buf, sizeof buf); @@ -1352,40 +1420,41 @@ void display_editroom(void) extract_token(recp, buf, 1, '|', sizeof recp); escputs(recp); - wprintf(" (remove)
    "); - + wprintf("&tab=listserv\">"); + wprintf(_("(remove)")); + wprintf("
    "); } } - wprintf("
    \n" + wprintf("
    \n" "\n" "\n"); wprintf("\n"); - wprintf(""); + wprintf("", _("Add")); wprintf("
    \n"); wprintf("

    \n"); if (self_service(999) == 1) { - wprintf("This room is configured to allow " - "self-service subscribe/unsubscribe requests." - " " - "Click to disable.
    \n" - "The URL for subscribe/unsubscribe is: " - "http://%s/listsub
    \n", - WC->http_host - ); + wprintf(_("This room is configured to allow " + "self-service subscribe/unsubscribe requests.")); + wprintf(""); + wprintf(_("Click to disable.")); + wprintf("
    \n"); + wprintf(_("The URL for subscribe/unsubscribe is: ")); + wprintf("%s://%s/listsub
    \n", + (is_https ? "https" : "http"), + WC->http_host); } else { - wprintf("This room is not configured to allow " - "self-service subscribe/unsubscribe requests." - " " - "Click to enable.
    \n" - ); + wprintf(_("This room is not configured to allow " + "self-service subscribe/unsubscribe requests.")); + wprintf(" "); + wprintf(_("Click to enable.")); + wprintf("
    \n"); } @@ -1393,7 +1462,7 @@ void display_editroom(void) } - /* Mailing list management */ + /** Mailing list management */ if (!strcmp(tab, "expire")) { serv_puts("GPEX room"); @@ -1410,54 +1479,66 @@ void display_editroom(void) floorvalue = extract_int(&buf[4], 1); } - wprintf("
    \n"); + wprintf("
    \n"); wprintf("\n"); - wprintf("\n"); if (WC->axlevel >= 6) { wprintf("\n"); - wprintf("\n"); wprintf("
    Message expire policy for this room
    ("); + wprintf("
    "); + wprintf(_("Message expire policy for this room")); + wprintf("
    ("); escputs(WC->wc_roomname); wprintf(")
    "); wprintf("", ((roompolicy == 0) ? "CHECKED" : "") ); - wprintf("Use the default policy for this floor
    \n"); + wprintf(_("Use the default policy for this floor")); + wprintf("
    \n"); wprintf("", ((roompolicy == 1) ? "CHECKED" : "") ); - wprintf("Never automatically expire messages
    \n"); + wprintf(_("Never automatically expire messages")); + 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
    "); - wprintf("Number of messages or days: "); + wprintf(_("Expire by message age")); + wprintf("
    "); + wprintf(_("Number of messages or days: ")); wprintf("", roomvalue); wprintf("

    Message expire policy for this floor
    ("); + wprintf("
    "); + wprintf(_("Message expire policy for this floor")); + wprintf("
    ("); escputs(floorlist[WC->wc_floor]); wprintf(")
    "); wprintf("", ((floorpolicy == 0) ? "CHECKED" : "") ); - wprintf("Use the system default
    \n"); + wprintf(_("Use the system default")); + wprintf("
    \n"); wprintf("", ((floorpolicy == 1) ? "CHECKED" : "") ); - wprintf("Never automatically expire messages
    \n"); + wprintf(_("Never automatically expire messages")); + wprintf("
    \n"); wprintf("", ((floorpolicy == 2) ? "CHECKED" : "") ); - wprintf("Expire by message count
    \n"); + wprintf(_("Expire by message count")); + wprintf("
    \n"); wprintf("", ((floorpolicy == 3) ? "CHECKED" : "") ); - wprintf("Expire by message age
    "); - wprintf("Number of messages or days: "); + wprintf(_("Expire by message age")); + wprintf("
    "); + wprintf(_("Number of messages or days: ")); wprintf("", floorvalue); } wprintf("
    \n"); wprintf("

    \n"); - wprintf(""); + wprintf("", _("Save changes")); wprintf(" "); - wprintf(""); + wprintf("", _("Cancel")); wprintf("
    \n" @@ -1467,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; @@ -1492,13 +1573,13 @@ void toggle_self_service(void) { -/* - * save new parameters for a room +/** + * \brief save new parameters for a room */ void editroom(void) { char buf[SIZ]; - char er_name[20]; + char er_name[128]; char er_password[10]; char er_dirname[15]; char er_roomaide[26]; @@ -1507,9 +1588,9 @@ void editroom(void) int bump; - if (strcmp(bstr("sc"), "OK")) { + if (strlen(bstr("ok_button")) == 0) { strcpy(WC->ImportantMessage, - "Cancelled. Changes were not saved."); + _("Cancelled. Changes were not saved.")); display_editroom(); return; } @@ -1537,9 +1618,10 @@ void editroom(void) } } strcpy(buf, bstr("er_name")); - buf[20] = 0; - if (strlen(buf) > 0) + buf[128] = 0; + if (strlen(buf) > 0) { strcpy(er_name, buf); + } strcpy(buf, bstr("er_password")); buf[10] = 0; @@ -1647,14 +1729,14 @@ void editroom(void) } } gotoroom(er_name); - strcpy(WC->ImportantMessage, "Your changes have been saved."); + strcpy(WC->ImportantMessage, _("Your changes have been saved.")); display_editroom(); return; } -/* - * 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]; @@ -1670,7 +1752,7 @@ void do_invt_kick(void) { strcpy(username, bstr("username")); - if (!strcmp(bstr("sc"), "Kick")) { + if (strlen(bstr("kick_button")) > 0) { sprintf(buf, "KICK %s", username); serv_puts(buf); serv_getln(buf, sizeof buf); @@ -1679,12 +1761,12 @@ void do_invt_kick(void) { strcpy(WC->ImportantMessage, &buf[4]); } else { sprintf(WC->ImportantMessage, - "User %s kicked out of room %s.\n", + _("User %s kicked out of room %s.\n"), username, room); } } - if (!strcmp(bstr("sc"), "Invite")) { + if (strlen(bstr("invite_button")) > 0) { sprintf(buf, "INVT %s", username); serv_puts(buf); serv_getln(buf, sizeof buf); @@ -1693,7 +1775,7 @@ void do_invt_kick(void) { strcpy(WC->ImportantMessage, &buf[4]); } else { sprintf(WC->ImportantMessage, - "User %s invited to room %s.\n", + _("User %s invited to room %s.\n"), username, room); } } @@ -1703,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) { @@ -1720,12 +1802,13 @@ void display_whok(void) extract_token(room, &buf[4], 0, '|', sizeof room); - wprintf("" - "
    The users listed below have access to this room. " + wprintf("
    "); + wprintf(_("The users listed below have access to this room. " "To remove a user from the access list, select the user " - "name from the list and click 'Kick'.

    "); + "name from the list and click 'Kick'.")); + wprintf("

    "); - wprintf("
    \n"); + wprintf("
    \n"); wprintf("\n"); wprintf("
    \n"); - wprintf(""); + wprintf("", _("Kick")); wprintf("
    \n"); - wprintf("
    " - "To grant another user access to this room, enter the " - "user name in the box below and click 'Invite'.

    "); + wprintf("
    "); + wprintf(_("To grant another user access to this room, enter the " + "user name in the box below and click 'Invite'.")); + wprintf("

    "); - wprintf("
    \n"); + wprintf("
    \n"); wprintf("\n"); - wprintf("Invite: "); + wprintf(_("Invite:")); + wprintf(" "); wprintf("
    \n" - "" - "" - "
    \n"); + "" + "" + "
    \n", _("Invite")); wprintf("
    \n"); wDumpContent(1); @@ -1761,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) { @@ -1778,23 +1863,27 @@ void display_entroom(void) return; } - output_headers(1, 1, 2, 0, 0, 0, 0); + output_headers(1, 1, 2, 0, 0, 0); wprintf("
    \n" "
    " - "Create a new room" + ""); + wprintf(_("Create a new room")); + wprintf("" "
    \n" "
    \n
    \n" ); - wprintf("
    " + wprintf("
    " "
    \n"); - wprintf("
    \n"); + wprintf("\n"); - wprintf("
    • Name of room: "); + wprintf("
      • "); + wprintf(_("Name of room: ")); wprintf("\n"); - wprintf("
      • Resides on floor: "); + wprintf("
      • "); + wprintf(_("Resides on floor: ")); load_floorlist(); 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("
      • 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(" Public (automatically appears to everyone)\n"); + "\"> "); + wprintf(_("Public (automatically appears to everyone)")); - wprintf("
      • Private - hidden (accessible to anyone who knows its name)\n"); + "\"> "); + wprintf(_("Private - hidden (accessible to anyone who knows its name)")); - wprintf("
      • Private - require password:\n"); + "\"> "); + wprintf(_("Private - require password: ")); wprintf("\n"); wprintf("
      • Private - invitation only\n"); + "\"> "); + wprintf(_("Private - invitation only")); - wprintf("
      • Personal (mailbox for you only)\n"); + "\"> "); + wprintf(_("Personal (mailbox for you only)")); - wprintf("
      \n"); + wprintf("\n
    \n"); wprintf("
    \n"); - wprintf(""); + wprintf("", _("Create new room")); wprintf(" "); - wprintf(""); + wprintf("", _("Cancel")); wprintf("
    \n"); wprintf("
    \n
    "); serv_printf("MESG roomaccess"); serv_getln(buf, sizeof buf); if (buf[0] == '1') { - fmout(NULL, "CENTER"); + fmout("CENTER"); } wprintf("
    \n"); wDumpContent(1); @@ -1885,8 +1984,8 @@ void display_entroom(void) -/* - * support function for entroom() -- sets the default view +/** + * \brief support function for entroom() -- sets the default view */ void er_set_default_view(int newview) { @@ -1921,8 +2020,8 @@ void er_set_default_view(int newview) { -/* - * enter a new room +/** + * \brief enter a new room */ void entroom(void) { @@ -1934,9 +2033,9 @@ void entroom(void) int er_num_type; int er_view; - if (strcmp(bstr("sc"), "OK")) { + if (strlen(bstr("ok_button")) == 0) { strcpy(WC->ImportantMessage, - "Cancelled. No new room was created."); + _("Cancelled. No new room was created.")); display_main_menu(); return; } @@ -1970,63 +2069,71 @@ void entroom(void) } -/* - * display the screen to enter a private room +/** + * \brief display the screen to enter a private room */ void display_private(char *rname, int req_pass) { - output_headers(1, 1, 2, 0, 0, 0, 0); + output_headers(1, 1, 2, 0, 0, 0); wprintf("
    \n" "
    " - "Go to a hidden room" + ""); + wprintf(_("Go to a hidden room")); + wprintf("" "
    \n" "
    \n
    \n" ); - wprintf("
    " + wprintf("
    " "
    \n"); wprintf("
    \n"); - wprintf("
    If you know the name of a hidden (guess-name) or\n"); - wprintf("passworded room, you can enter that room by typing\n"); - wprintf("its name below. Once you gain access to a private\n"); - wprintf("room, it will appear in your regular room listings\n"); - wprintf("so you don't have to keep returning here.\n"); - wprintf("

    "); + wprintf("
    "); + wprintf(_("If you know the name of a hidden (guess-name) or " + "passworded room, you can enter that room by typing " + "its name below. Once you gain access to a private " + "room, it will appear in your regular room listings " + "so you don't have to keep returning here.")); + wprintf("\n

    "); - wprintf("
    \n"); + wprintf("\n"); wprintf("\n" - "
    " - "Enter room name:" + "
    "); + wprintf(_("Enter room name:")); + wprintf("" "\n", rname); + "VALUE=\"%s\" MAXLENGTH=\"128\">\n", rname); if (req_pass) { wprintf("
    "); - wprintf("Enter room password:"); + wprintf(_("Enter room password:")); + wprintf(""); wprintf("\n"); } wprintf("

    \n"); - wprintf("" + wprintf("" " " - ""); + "", + _("Go there"), + _("Cancel") + ); wprintf("
    \n"); wprintf("
    \n"); wDumpContent(1); } -/* - * goto a private room +/** + * \brief goto a private room */ void goto_private(void) { char hold_rm[SIZ]; char buf[SIZ]; - if (strcasecmp(bstr("sc"), "OK")) { + if (strlen(bstr("ok_button")) == 0) { display_main_menu(); return; } @@ -2046,53 +2153,56 @@ void goto_private(void) display_private(bstr("gr_name"), 1); return; } - output_headers(1, 1, 1, 0, 0, 0, 0); + output_headers(1, 1, 1, 0, 0, 0); wprintf("%s\n", &buf[4]); wDumpContent(1); return; } -/* - * display the screen to zap a room +/** + * \brief display the screen to zap a room */ void display_zap(void) { - output_headers(1, 1, 2, 0, 0, 0, 0); + output_headers(1, 1, 2, 0, 0, 0); wprintf("
    \n"); wprintf("
    "); - wprintf("Zap (forget/unsubscribe) the current room\n"); + wprintf(""); + wprintf(_("Zap (forget/unsubscribe) the current room")); + wprintf("\n"); wprintf("
    \n"); wprintf("
    \n
    \n"); - wprintf("If you select this option, %s will ", WC->wc_roomname); - wprintf("disappear from your room list. Is this what you wish "); - wprintf("to do?
    \n"); + wprintf(_("If you select this option, %s will " + "disappear from your room list. Is this what you wish " + "to do?
    \n"), WC->wc_roomname); - wprintf("
    \n"); - wprintf(""); + wprintf("\n"); + wprintf("", _("Zap this room")); wprintf(" "); - wprintf(""); + wprintf("", _("Cancel")); wprintf("
    \n"); wDumpContent(1); } -/* - * 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); - if (!strcasecmp(bstr("sc"), "OK")) { + if (strlen(bstr("ok_button")) > 0) { serv_printf("GOTO %s", WC->wc_roomname); serv_getln(buf, sizeof buf); if (buf[0] == '2') { @@ -2108,8 +2218,8 @@ void zap(void) -/* - * Delete the current room +/** + * \brief Delete the current room */ void delete_room(void) { @@ -2128,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; @@ -2163,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); @@ -2189,7 +2299,7 @@ void netedit(void) { serv_puts(buf); } - if (!strcasecmp(bstr("cmd"), "add")) { + if (strlen(bstr("add_button")) > 0) { serv_puts(line); } @@ -2200,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("