X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Froomops.c;h=1327f55d68099fd65652ac5b8011b0946cecdf0d;hb=8c7819e29bd976ec4882075f12480c12dc3691bd;hp=b79351d52e852178036527d1f250e5a0b830cc4a;hpb=8d8c5af38e5026933ea3b9d5eb1b75f276df1d99;p=citadel.git diff --git a/webcit/roomops.c b/webcit/roomops.c index b79351d52..1327f55d6 100644 --- a/webcit/roomops.c +++ b/webcit/roomops.c @@ -10,7 +10,7 @@ char floorlist[128][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 @@ -24,6 +24,7 @@ void initialize_viewdefs(void) { viewdefs[5] = _("Notes List"); viewdefs[6] = _("Wiki"); viewdefs[7] = _("Calendar List"); + viewdefs[8] = _("Journal"); } /** @@ -42,6 +43,7 @@ int is_view_allowed_as_default(int which_view) case VIEW_NOTES: return(1); case VIEW_WIKI: return(0); /**< because it isn't finished yet */ case VIEW_CALBRIEF: return(0); + case VIEW_JOURNAL: return(0); default: return(0); /**< should never get here */ } } @@ -151,7 +153,7 @@ void room_tree_list(struct roomlisting *rp) wprintf(")"); else wprintf(">"); - wprintf(" \n"); + wprintf(" \n"); room_tree_list(rp->rnext); free(rp); @@ -197,7 +199,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 +206,7 @@ void listrms(char *variety) wprintf(" "); return; } + while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) { ++num_rooms; rp = malloc(sizeof(struct roomlisting)); @@ -253,7 +255,7 @@ 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")); do_template("beginbox"); @@ -272,12 +274,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("
"); + escputs(briefinfo); + wprintf("
"); + wprintf("\"%s\"", + _("Close window") + ); + escputs(fullinfo); + wprintf("
"); } else { wprintf(" "); @@ -300,7 +327,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"); @@ -353,12 +380,13 @@ void embed_room_graphic(void) { void embed_view_o_matic(void) { int i; - wprintf("
\n" - ""); + wprintf("\n"); + wprintf("\n", WC->nonce); + wprintf("
\n"); + wprintf("\n"); } @@ -391,14 +419,15 @@ void embed_view_o_matic(void) { * \brief Display a search box */ void embed_search_o_matic(void) { - wprintf("
\n" - ""); + wprintf("\n"); + wprintf("\n", WC->nonce); + wprintf(" \n" ); - wprintf("
\n"); + wprintf("\n"); } @@ -409,8 +438,10 @@ void embed_search_o_matic(void) { * \param navbar_style Determines which navigation buttons to display * */ + void embed_room_banner(char *got, int navbar_style) { char buf[256]; + char sanitized_roomname[256]; /** * We need to have the information returned by a GOTO server command. @@ -441,7 +472,8 @@ void embed_room_banner(char *got, int navbar_style) { WC->new_mail = extract_int(&got[4], 9); WC->wc_view = extract_int(&got[4], 11); - svprintf("ROOMNAME", WCS_STRING, "%s", WC->wc_roomname); + stresc(sanitized_roomname, 256, WC->wc_roomname, 1, 1); + svprintf("ROOMNAME", WCS_STRING, "%s", sanitized_roomname); svprintf("NUMMSGS", WCS_STRING, _("%d new of %d messages"), extract_int(&got[4], 1), @@ -456,25 +488,23 @@ void embed_room_banner(char *got, int navbar_style) { do_template("roombanner"); if (navbar_style != navbar_none) { - wprintf("
\n" - "\n"); - + wprintf("
\n", _("Ungoto") + "\n", _("Ungoto") ); if ( (navbar_style == navbar_default) && (WC->wc_view == VIEW_BBS) ) { wprintf( - "\n", _("Read new messages") + "\n", _("Read new messages") ); } @@ -482,99 +512,99 @@ void embed_room_banner(char *got, int navbar_style) { switch(WC->wc_view) { case VIEW_ADDRESSBOOK: wprintf( - "\n", _("View contacts") + "\n", _("View contacts") ); break; case VIEW_CALENDAR: wprintf( - "\n", _("Day view") + "\n", _("Day view") ); wprintf( - "\n", _("Month view") + "\n", _("Month view") ); break; case VIEW_CALBRIEF: wprintf( - "\n", _("Calendar list") + "\n", _("Calendar list") ); break; case VIEW_TASKS: wprintf( - "\n", _("View tasks") + "\n", _("View tasks") ); break; case VIEW_NOTES: wprintf( - "\n", _("View notes") + "\n", _("View notes") ); break; case VIEW_MAILBOX: wprintf( - "\n", _("View message list") + "\n", _("View message list") ); break; case VIEW_WIKI: wprintf( - "\n", _("Wiki home") + "\n", _("Wiki home") ); break; default: wprintf( - "\n", _("Read all messages") + "\n", _("Read all messages") ); break; } @@ -584,98 +614,110 @@ void embed_room_banner(char *got, int navbar_style) { switch(WC->wc_view) { case VIEW_ADDRESSBOOK: wprintf( - "\n", _("Add new contact") + "\n", _("Add new contact") ); break; case VIEW_CALENDAR: case VIEW_CALBRIEF: - wprintf("\n", _("Add new event") + "\n", _("Add new event") ); break; case VIEW_TASKS: wprintf( - "\n", _("Add new task") + "\n", _("Add new task") ); break; case VIEW_NOTES: wprintf( - "\n", _("Add new note") + "\n", _("Add new note") ); break; case VIEW_WIKI: safestrncpy(buf, bstr("page"), sizeof buf); str_wiki_index(buf); wprintf( - "\n", buf, _("Edit this page") + "\n", buf, _("Edit this page") + ); + break; + case VIEW_MAILBOX: + wprintf( + "
  • " + "" + "" + "%s" + "
  • \n", _("Write mail") ); break; default: wprintf( - "\n", _("Enter a message") + "\n", _("Enter a message") ); break; } } if (navbar_style == navbar_default) wprintf( - "\n", + "\n", _("Leave all messages marked as unread, go to next room with unread messages"), _("Skip this room") ); if (navbar_style == navbar_default) wprintf( - "\n", + "\n", _("Mark all messages as read, go to next room with unread messages"), _("Goto next room") ); - wprintf("
    " + "
  • " "" "" "%s" - "
  • " + "
  • " "" "" "%s" - "
  • " + "
  • " "" "" "" "%s" - "
  • " + "
  • " "" "" "" "%s" - "
  • " + "
  • " "" "" "" "%s" - "
  • " + "
  • " "" "" "" "%s" - "
  • " + "
  • " "" "" "" "%s" - "
  • " + "
  • " "" "" "" "%s" - "
  • " + "
  • " "" "" "" "%s" - "
  • " + "
  • " "" "" "" "%s" - "
  • " + "
  • " "" "" "" "%s" - "
  • " + "
  • " + "" "" "%s" - "
  • 0) wprintf("?year=%s", bstr("year")); - if (strlen(bstr("month")) > 0) wprintf("?month=%s", bstr("month")); - if (strlen(bstr("day")) > 0) wprintf("?day=%s", bstr("day")); + wprintf("
  • " "" "%s" - "
  • " + "
  • " + "" "" "%s" - "
  • " + "
  • " + "" "" "%s" - "
  • " + "
  • " + "" "" "%s" - "
  • " + "
  • " + "" "" "%s" - "
  • " + "
  • " "" + "title=\"%s\">" "" "%s" - "
  • " + "
  • " "" + "title=\"%s\">" "" "%s" - "
  • \n"); + wprintf("\n"); } } - - - /** * \brief back end routine to take the session to a new room * \param gname room to go to @@ -716,6 +758,7 @@ int gotoroom(char *gname) WC->wc_view = extract_int(&buf[4], 11); WC->wc_default_view = extract_int(&buf[4], 12); WC->wc_is_trash = extract_int(&buf[4], 13); + WC->room_flags2 = extract_int(&buf[4], 14); if (WC->is_aide) WC->is_room_aide = WC->is_aide; @@ -784,6 +827,7 @@ void gotonext(void) { char buf[256]; struct march *mptr, *mptr2; + char room_name[128]; char next_room[128]; /** @@ -796,18 +840,21 @@ void gotonext(void) serv_getln(buf, sizeof buf); if (buf[0] == '1') while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) { - mptr = (struct march *) malloc(sizeof(struct march)); - mptr->next = NULL; - extract_token(mptr->march_name, buf, 0, '|', sizeof mptr->march_name); - mptr->march_floor = extract_int(buf, 2); - mptr->march_order = extract_int(buf, 3); - if (WC->march == NULL) { - WC->march = mptr; - } else { - mptr2 = WC->march; - while (mptr2->next != NULL) - mptr2 = mptr2->next; - mptr2->next = mptr; + extract_token(room_name, buf, 0, '|', sizeof room_name); + if (strcasecmp(room_name, WC->wc_roomname)) { + mptr = (struct march *) malloc(sizeof(struct march)); + mptr->next = NULL; + safestrncpy(mptr->march_name, room_name, sizeof mptr->march_name); + mptr->march_floor = extract_int(buf, 2); + mptr->march_order = extract_int(buf, 3); + if (WC->march == NULL) { + WC->march = mptr; + } else { + mptr2 = WC->march; + while (mptr2->next != NULL) + mptr2 = mptr2->next; + mptr2->next = mptr; + } } } /** @@ -816,6 +863,8 @@ void gotonext(void) */ mptr = (struct march *) malloc(sizeof(struct march)); mptr->next = NULL; + mptr->march_order = 0; + mptr->march_floor = 0; strcpy(mptr->march_name, "_BASEROOM_"); if (WC->march == NULL) { WC->march = mptr; @@ -963,15 +1012,16 @@ int self_service(int newval) { void display_editroom(void) { char buf[SIZ]; - char cmd[SIZ]; - char node[SIZ]; - char remote_room[SIZ]; - char recp[SIZ]; + char cmd[1024]; + char node[256]; + char remote_room[128]; + char recp[1024]; char er_name[128]; char er_password[10]; char er_dirname[15]; char er_roomaide[26]; unsigned er_flags; + unsigned er_flags2; int er_floor; int i, j; char *tab; @@ -983,7 +1033,7 @@ void display_editroom(void) int floorvalue = 0; tab = bstr("tab"); - if (strlen(tab) == 0) tab = "admin"; + if (IsEmptyStr(tab)) tab = "admin"; load_floorlist(); serv_puts("GETR"); @@ -999,152 +1049,128 @@ void display_editroom(void) extract_token(er_dirname, &buf[4], 2, '|', sizeof er_dirname); er_flags = extract_int(&buf[4], 3); er_floor = extract_int(&buf[4], 4); + er_flags2 = extract_int(&buf[4], 7); output_headers(1, 1, 1, 0, 0, 0); + wprintf("
    "); + /** print the tabbed dialog */ - wprintf("
    " - "
    " - "" - "" - "\n"); + wprintf("\n"); + wprintf("< tab_cell_edit\">"); + wprintf(_("Administration")); + wprintf(""); } - else { - wprintf("\n"); - } - - wprintf("\n"); + wprintf("\n"); + wprintf("
  • "); + wprintf(" tab_cell_label\">"); + wprintf(_("Configuration")); } else { - wprintf("
  • \n"); - } - else { - wprintf("\n"); - } - - wprintf("\n"); - - if (!strcmp(tab, "expire")) { - wprintf("\n"); + wprintf(" tab_cell_label\">"); + wprintf(_("Message expire policy")); } else { - wprintf("\n"); + wprintf(" tab_cell_edit\">"); + wprintf(_("Message expire policy")); + wprintf(""); } + wprintf("\n"); - wprintf("\n"); - - if (!strcmp(tab, "access")) { - wprintf("\n"); + wprintf(" tab_cell_label\">"); + wprintf(_("Access controls")); } else { - wprintf("\n"); + wprintf(" tab_cell_edit\">"); + wprintf(_("Access controls")); + wprintf(""); } + wprintf("\n"); - wprintf("\n"); - - if (!strcmp(tab, "sharing")) { - wprintf("\n"); + wprintf(" tab_cell_label\">"); + wprintf(_("Sharing")); } else { - wprintf("\n"); + wprintf(" tab_cell_edit\">"); + wprintf(_("Sharing")); + wprintf(""); } + wprintf("\n"); - wprintf("\n"); - - if (!strcmp(tab, "listserv")) { - wprintf("\n"); + wprintf(" tab_cell_label\">"); + wprintf(_("Mailing list service")); } else { - wprintf("\n"); + wprintf("< tab_cell_edit\">"); + wprintf(_("Mailing list service")); + wprintf(""); } + wprintf("\n"); - wprintf("\n"); - - wprintf("
     "); - } - wprintf(_("Administration")); - if (!strcmp(tab, "admin")) { - wprintf(" "); + wprintf(" tab_cell_edit\">"); + wprintf(_("Configuration")); + wprintf(""); } - wprintf(_("Configuration")); - if (!strcmp(tab, "config")) { - wprintf(" "); - } - else { - wprintf(""); - } - wprintf(_("Message expire policy")); + wprintf("\n"); + + wprintf("
  •  "); - } - else { - wprintf(""); - } - wprintf(_("Access controls")); + wprintf("
  •  "); - } - else { - wprintf(""); - } - wprintf(_("Sharing")); + wprintf("
  •  "); - } - else { - wprintf(""); - } - wprintf(_("Mailing list service")); + wprintf("
  •  
    \n"); + wprintf("\n"); /** end tabbed dialog */ /** begin content of whatever tab is open now */ - wprintf("
    " - "\n" - "
    \n"); if (!strcmp(tab, "admin")) { - wprintf(""); + wprintf(""); } if (!strcmp(tab, "config")) { - wprintf("
    \n"); + wprintf("
    "); + wprintf("\n"); + wprintf("\n", WC->nonce); - wprintf("
    • "); + wprintf("
      • "); wprintf(_("Name of room: ")); - wprintf("\n", + wprintf("\n", er_name, (sizeof(er_name)-1) ); - wprintf("
      • "); + wprintf("
      • "); wprintf(_("Resides on floor: ")); - wprintf("\n"); for (i = 0; i < 128; ++i) - if (strlen(floorlist[i]) > 0) { + if (!IsEmptyStr(floorlist[i])) { wprintf("
      • "); + wprintf("
      • "); wprintf(_("Type of room:")); - wprintf("
          \n"); + wprintf("
            \n"); - wprintf("
          • "); - wprintf(_("Public room")); + wprintf(_("Public (automatically appears to everyone)")); wprintf("\n"); - wprintf("
          • "); - wprintf(_("Private - guess name")); + wprintf(_("Private - hidden (accessible to anyone who knows its name)")); - wprintf("\n
          • "); - wprintf(_("Private - require password:")); - wprintf("\n\n", + wprintf(_("Private - require password: ")); + wprintf("\n\n", er_password); - wprintf("
          • "); wprintf(_("Private - invitation only")); - wprintf("\n
          • "); wprintf(_("If private, cause current users to forget room")); - wprintf("\n
          \n"); + wprintf("\n
        \n"); - wprintf("
      • "); wprintf(_("Preferred users only")); - wprintf("\n
      • "); wprintf(_("Read-only room")); + wprintf("\n
      • "); + wprintf(_("All users allowed to post may also delete messages")); + /** directory stuff */ - wprintf("\n
      • "); wprintf(_("File directory room")); - wprintf("\n
        • "); + wprintf("\n
          • "); wprintf(_("Directory name: ")); - wprintf("\n", + wprintf("\n", er_dirname); - wprintf("
          • "); wprintf(_("Uploading allowed")); - wprintf("\n
          • "); wprintf(_("Downloading allowed")); - wprintf("\n
          • "); wprintf(_("Visible directory")); - wprintf("
          \n"); + wprintf("
        \n"); /** end of directory stuff */ - wprintf("
      • "); wprintf(_("Network shared room")); - wprintf("\n
      • "); wprintf(_("Permanent (does not auto-purge)")); + wprintf("\n
      • "); + wprintf(_("Subject Required (Force users to specify a message subject)")); + /** start of anon options */ - wprintf("\n
      • "); + wprintf("\n
      • "); wprintf(_("Anonymous messages")); - wprintf("
          \n"); + wprintf("
            \n"); - wprintf("
          • "); wprintf(_("No anonymous messages")); - wprintf("\n
          • "); wprintf(_("All messages are anonymous")); - wprintf("\n
          • "); wprintf(_("Prompt user when entering messages")); - wprintf("
          \n"); + wprintf("
        \n"); /* end of anon options */ - wprintf("
      • "); + wprintf("
      • "); wprintf(_("Room aide: ")); serv_puts("GETA"); serv_getln(buf, sizeof buf); @@ -1288,23 +1326,25 @@ void display_editroom(void) wprintf("%s\n", &buf[4]); } else { extract_token(er_roomaide, &buf[4], 0, '|', sizeof er_roomaide); - wprintf("\n", er_roomaide); + wprintf("\n", er_roomaide); } - wprintf("
      \n"); - wprintf("\n" - "" + wprintf("
    \n"); + wprintf("\n" + "" " " - "" + "" "
    \n", _("Save changes"), _("Cancel") ); + wprintf("
    "); } /** Sharing the room with other Citadel nodes... */ if (!strcmp(tab, "sharing")) { + wprintf("
    "); shared_with = strdup(""); not_shared_with = strdup(""); @@ -1330,7 +1370,7 @@ void display_editroom(void) shared_with = realloc(shared_with, strlen(shared_with) + 32); strcat(shared_with, node); - if (strlen(remote_room) > 0) { + if (!IsEmptyStr(remote_room)) { strcat(shared_with, "|"); strcat(shared_with, remote_room); } @@ -1351,119 +1391,121 @@ void display_editroom(void) /** Display the stuff */ wprintf("

    " - "" - "" + "
    "); + "" + "" - "" + "\n" - "\n" + "
    "); wprintf(_("Shared with")); - wprintf(""); + wprintf(""); wprintf(_("Not shared with")); - wprintf("
    \n"); + wprintf("
    \n"); - wprintf("" - "
    "); + wprintf("\n"); + wprintf("\n"); for (i=0; i 0) { - wprintf("" - "\n", node); + if (!IsEmptyStr(node)) { + wprintf(""); + wprintf("\n", WC->nonce); + wprintf("\n", node); - wprintf(""); + wprintf(""); - wprintf("\n"); + wprintf("\n"); } } - wprintf("
    "); wprintf(_("Remote node name")); - wprintf(""); + wprintf(""); wprintf(_("Remote room name")); - wprintf(""); + wprintf(""); wprintf(_("Actions")); - wprintf("
    %s
    %s"); - if (strlen(remote_room) > 0) { + wprintf(""); + if (!IsEmptyStr(remote_room)) { escputs(remote_room); } - wprintf(""); + wprintf(""); - wprintf(" 0) { + if (!IsEmptyStr(remote_room)) { wprintf("|"); urlescputs(remote_room); } wprintf("\">"); - wprintf("\n"); - wprintf("\n"); - wprintf("", _("Unshare")); - wprintf("
    \n"); - wprintf("
    \n"); - wprintf("
    "); + wprintf("
    \n"); + wprintf("
    \n"); + wprintf("\n"); + wprintf("\n"); for (i=0; i 0) { - wprintf("
    " - "
    \n"); + wprintf("\n"); } } - wprintf("
    "); wprintf(_("Remote node name")); - wprintf(""); + wprintf(""); wprintf(_("Remote room name")); - wprintf(""); + wprintf(""); wprintf(_("Actions")); - wprintf("
    "); + if (!IsEmptyStr(node)) { + wprintf(""); + wprintf("\n", WC->nonce); + wprintf("
    "); escputs(node); - wprintf("" - "" + "" - ""); - wprintf(""); + wprintf(""); - wprintf("\n"); - wprintf("\n"); - wprintf("", _("Share")); - wprintf("
    \n"); - wprintf("

    \n" - "%s
    • ", _("Notes:")); + wprintf("
    \n"); + wprintf("

    \n" + "%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. " - "
    • If the remote room name is blank, it is assumed " + "
    • 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 " + "
    • If the remote room name is different, the remote " "node must also configure the name of the room here." - "

    \n" + "
    \n" )); + wprintf("
    "); } /** Mailing list management */ if (!strcmp(tab, "listserv")) { + wprintf("
    "); wprintf("
    " - "" - "
    "); + "" + "
    "); wprintf(_("The contents of this room are being " "mailed as individual messages " @@ -1478,22 +1520,22 @@ void display_editroom(void) extract_token(recp, buf, 1, '|', sizeof recp); escputs(recp); - wprintf(" "); + wprintf("\">"); wprintf(_("(remove)")); wprintf("
    "); } } - wprintf("
    \n" - "\n" - "\n"); - wprintf("\n"); - wprintf("", _("Add")); - wprintf("
    \n"); - - wprintf("
    \n"); + wprintf("
    \n" + "\n" + "\n"); + wprintf("\n", WC->nonce); + wprintf("\n"); + wprintf("", _("Add")); + wprintf("
    \n"); + + wprintf("
    \n"); wprintf(_("The contents of this room are being " "mailed in digest form " @@ -1508,23 +1550,39 @@ void display_editroom(void) extract_token(recp, buf, 1, '|', sizeof recp); escputs(recp); - wprintf(" "); + wprintf("\">"); wprintf(_("(remove)")); wprintf("
    "); } } - wprintf("
    \n" - "\n" - "\n"); - wprintf("\n"); - wprintf("", _("Add")); - wprintf("
    \n"); + wprintf("
    \n" + "\n" + "\n"); + wprintf("\n", WC->nonce); + wprintf("\n"); + wprintf("", _("Add")); + wprintf("
    \n"); - wprintf("

    \n"); + wprintf("
    \n"); + + /** Pop open an address book -- begin **/ + wprintf("
    " + "" + "" + " %s" + "
    ", + _("List"), + _("Digest"), + _("Add recipients from Contacts or other address books"), + _("Add recipients from Contacts or other address books") + ); + /** Pop open an address book -- end **/ + wprintf("
    "); if (self_service(999) == 1) { wprintf(_("This room is configured to allow " "self-service subscribe/unsubscribe requests.")); @@ -1547,11 +1605,13 @@ void display_editroom(void) wprintf("
    \n"); + wprintf("
    "); } /** Mailing list management */ if (!strcmp(tab, "expire")) { + wprintf("
    "); serv_puts("GPEX room"); serv_getln(buf, sizeof buf); @@ -1567,83 +1627,88 @@ void display_editroom(void) floorvalue = extract_int(&buf[4], 1); } - wprintf("
    \n"); - wprintf("\n"); - wprintf("
    "); + wprintf("
    \n"); + wprintf("\n", WC->nonce); + wprintf("\n"); + wprintf("\n"); + wprintf("", roomvalue); + wprintf("\n"); if (WC->axlevel >= 6) { - wprintf("\n"); - wprintf("\n"); + wprintf("\n"); + wprintf("", _("Cancel")); + wprintf("\n"); - wprintf("
    "); wprintf(_("Message expire policy for this room")); wprintf("
    ("); escputs(WC->wc_roomname); - wprintf(")
    "); - wprintf("", + wprintf(")"); + wprintf("", ((roompolicy == 0) ? "CHECKED" : "") ); wprintf(_("Use the default policy for this floor")); wprintf("
    \n"); - wprintf("", + wprintf("", ((roompolicy == 1) ? "CHECKED" : "") ); wprintf(_("Never automatically expire messages")); wprintf("
    \n"); - wprintf("", + wprintf("", ((roompolicy == 2) ? "CHECKED" : "") ); wprintf(_("Expire by message count")); wprintf("
    \n"); - wprintf("", + wprintf("", ((roompolicy == 3) ? "CHECKED" : "") ); wprintf(_("Expire by message age")); wprintf("
    "); wprintf(_("Number of messages or days: ")); - wprintf("", roomvalue); - wprintf("

    "); + wprintf("

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

    \n"); - wprintf("", _("Save changes")); + wprintf("

    \n"); + wprintf("", _("Save changes")); wprintf(" "); - wprintf("", _("Cancel")); - wprintf("
    \n" - "\n" - "\n" + wprintf("
    \n" + "\n" + "\n" ); + wprintf("
    "); } /** Mailing list management */ if (!strcmp(tab, "access")) { + wprintf("
    "); display_whok(); + wprintf("
    "); } /** end content of whatever tab is open now */ - wprintf("
    \n"); + wprintf("
    \n"); + address_book_popup(); wDumpContent(1); } @@ -1673,10 +1738,13 @@ void editroom(void) char er_roomaide[26]; int er_floor; unsigned er_flags; + int er_listingorder; + int er_defaultview; + unsigned er_flags2; int bump; - if (strlen(bstr("ok_button")) == 0) { + if (IsEmptyStr(bstr("ok_button"))) { strcpy(WC->ImportantMessage, _("Cancelled. Changes were not saved.")); display_editroom(); @@ -1694,9 +1762,12 @@ void editroom(void) extract_token(er_password, &buf[4], 1, '|', sizeof er_password); extract_token(er_dirname, &buf[4], 2, '|', sizeof er_dirname); er_flags = extract_int(&buf[4], 3); + er_listingorder = extract_int(&buf[4], 5); + er_defaultview = extract_int(&buf[4], 6); + er_flags2 = extract_int(&buf[4], 7); strcpy(er_roomaide, bstr("er_roomaide")); - if (strlen(er_roomaide) == 0) { + if (IsEmptyStr(er_roomaide)) { serv_puts("GETA"); serv_getln(buf, sizeof buf); if (buf[0] != '2') { @@ -1707,18 +1778,18 @@ void editroom(void) } strcpy(buf, bstr("er_name")); buf[128] = 0; - if (strlen(buf) > 0) { + if (!IsEmptyStr(buf)) { strcpy(er_name, buf); } strcpy(buf, bstr("er_password")); buf[10] = 0; - if (strlen(buf) > 0) + if (!IsEmptyStr(buf)) strcpy(er_password, buf); strcpy(buf, bstr("er_dirname")); buf[15] = 0; - if (strlen(buf) > 0) + if (!IsEmptyStr(buf)) strcpy(er_dirname, buf); strcpy(buf, bstr("type")); @@ -1745,12 +1816,24 @@ void editroom(void) er_flags &= ~QR_READONLY; } + if (!strcmp(bstr("collabdel"), "yes")) { + er_flags2 |= QR2_COLLABDEL; + } else { + er_flags2 &= ~QR2_COLLABDEL; + } + if (!strcmp(bstr("permanent"), "yes")) { er_flags |= QR_PERMANENT; } else { er_flags &= ~QR_PERMANENT; } + if (!strcmp(bstr("subjectreq"), "yes")) { + er_flags2 |= QR2_SUBJECTREQ; + } else { + er_flags2 &= ~QR2_SUBJECTREQ; + } + if (!strcmp(bstr("network"), "yes")) { er_flags |= QR_NETWORK; } else { @@ -1795,8 +1878,9 @@ void editroom(void) er_floor = atoi(bstr("er_floor")); - sprintf(buf, "SETR %s|%s|%s|%u|%d|%d", - er_name, er_password, er_dirname, er_flags, bump, er_floor); + sprintf(buf, "SETR %s|%s|%s|%u|%d|%d|%d|%d|%u", + er_name, er_password, er_dirname, er_flags, bump, er_floor, + er_listingorder, er_defaultview, er_flags2); serv_puts(buf); serv_getln(buf, sizeof buf); if (buf[0] != '2') { @@ -1806,7 +1890,7 @@ void editroom(void) } gotoroom(er_name); - if (strlen(er_roomaide) > 0) { + if (!IsEmptyStr(er_roomaide)) { sprintf(buf, "SETA %s", er_roomaide); serv_puts(buf); serv_getln(buf, sizeof buf); @@ -1840,7 +1924,7 @@ void do_invt_kick(void) { strcpy(username, bstr("username")); - if (strlen(bstr("kick_button")) > 0) { + if (!IsEmptyStr(bstr("kick_button"))) { sprintf(buf, "KICK %s", username); serv_puts(buf); serv_getln(buf, sizeof buf); @@ -1854,7 +1938,7 @@ void do_invt_kick(void) { } } - if (strlen(bstr("invite_button")) > 0) { + if (!IsEmptyStr(bstr("invite_button"))) { sprintf(buf, "INVT %s", username); serv_puts(buf); serv_getln(buf, sizeof buf); @@ -1890,15 +1974,16 @@ void display_whok(void) extract_token(room, &buf[4], 0, '|', sizeof room); - wprintf("
    "); + 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'.")); wprintf("

    "); - wprintf("
    \n"); - wprintf("\n"); - wprintf("\n", WC->nonce); + wprintf("\n"); + wprintf("
    \n"); + wprintf("
    \n"); wprintf("", _("Kick")); - wprintf("
    \n"); + wprintf("\n"); - wprintf("
    "); + 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("\n"); + wprintf("\n", WC->nonce); wprintf(_("Invite:")); wprintf(" "); wprintf("
    \n" "" "" - "
    \n", _("Invite")); + "
    \n", _("Invite")); - wprintf("
    \n"); + wprintf("
    \n"); wDumpContent(1); } @@ -1951,37 +2037,36 @@ void display_entroom(void) return; } - output_headers(1, 1, 2, 0, 0, 0); - wprintf("
    \n" - "
    " - ""); - wprintf(_("Create a new room")); - wprintf("" - "
    \n" - "
    \n
    \n" - ); + output_headers(1, 1, 1, 0, 0, 0); - wprintf("
    " - "
    \n"); + svprintf("BOXTITLE", WCS_STRING, _("Create a new room")); + do_template("beginbox"); wprintf("
    \n"); + wprintf("\n", WC->nonce); - wprintf("
    • "); + wprintf(" "); + + wprintf(""); - wprintf("
    • "); + wprintf("
    • "); /** * Our clever little snippet of JavaScript automatically selects @@ -1989,9 +2074,10 @@ void display_entroom(void) * 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("
    • "); - wprintf("
    • "); + wprintf("
    • "); wprintf(_("Name of room: ")); - wprintf("\n"); + wprintf(""); + wprintf("\n"); + wprintf("
      "); wprintf(_("Resides on floor: ")); + wprintf(""); load_floorlist(); - wprintf("\n"); for (i = 0; i < 128; ++i) - if (strlen(floorlist[i]) > 0) { - wprintf("\n"); + wprintf("\n"); } - wprintf("\n"); + wprintf("\n"); + wprintf("
      "); + wprintf(_("Default view for room: ")); + wprintf(""); + wprintf("\n"); + wprintf("\n"); + wprintf("
      "); wprintf(_("Type of room:")); - wprintf("
        \n"); + wprintf("
      "); + wprintf("
        \n"); - wprintf("
      • "); wprintf(_("Public (automatically appears to everyone)")); + wprintf("
      • "); - wprintf("\n
      • "); wprintf(_("Private - hidden (accessible to anyone who knows its name)")); + wprintf("
      • "); - wprintf("\n
      • "); wprintf(_("Private - require password: ")); - wprintf("\n"); + wprintf("\n"); + wprintf("
      • "); - wprintf("
      • "); wprintf(_("Private - invitation only")); + wprintf("
      • "); - wprintf("\n
      • "); wprintf(_("Personal (mailbox for you only)")); + wprintf("
      • "); - wprintf("\n
      \n"); + wprintf("\n\n"); + wprintf("
      \n"); - wprintf("
      \n"); - wprintf("", _("Create new room")); + wprintf("
      \n"); + wprintf("", _("Create new room")); wprintf(" "); - wprintf("", _("Cancel")); - wprintf("
      \n"); - wprintf("
    • \n
      "); + wprintf("", _("Cancel")); + wprintf("\n"); + wprintf("\n
      "); serv_printf("MESG roomaccess"); serv_getln(buf, sizeof buf); if (buf[0] == '1') { - fmout("CENTER"); + fmout("LEFT"); } - wprintf("
    \n"); + + do_template("endbox"); + wDumpContent(1); } @@ -2123,7 +2219,7 @@ void entroom(void) int er_num_type; int er_view; - if (strlen(bstr("ok_button")) == 0) { + if (IsEmptyStr(bstr("ok_button"))) { strcpy(WC->ImportantMessage, _("Cancelled. No new room was created.")); display_main_menu(); @@ -2164,54 +2260,48 @@ void entroom(void) */ void display_private(char *rname, int req_pass) { - output_headers(1, 1, 2, 0, 0, 0); - wprintf("
    \n" - "
    " - ""); - wprintf(_("Go to a hidden room")); - wprintf("" - "
    \n" - "
    \n
    \n" - ); + output_headers(1, 1, 1, 0, 0, 0); - wprintf("
    " - "
    \n"); + svprintf("BOXTITLE", WCS_STRING, _("Go to a hidden room")); + do_template("beginbox"); - wprintf("
    \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("

    "); - wprintf("
    \n"); + wprintf("\n"); + wprintf("\n", WC->nonce); - wprintf("\n" - "
    "); + wprintf(" " + "
    "); wprintf(_("Enter room name:")); - wprintf("" - "\n", rname); + wprintf("" + "\n", rname); if (req_pass) { - wprintf("
    "); + wprintf("
    "); wprintf(_("Enter room password:")); - wprintf(""); - wprintf("\n"); + wprintf(""); + wprintf("\n"); } - wprintf("

    \n"); + wprintf("
    \n"); - wprintf("" + wprintf("
    \n"); + wprintf("" " " - "", + "", _("Go there"), _("Cancel") ); - wprintf("\n"); - wprintf("
    \n"); + wprintf("
    \n"); + + do_template("endbox"); + wDumpContent(1); } @@ -2223,7 +2313,7 @@ void goto_private(void) char hold_rm[SIZ]; char buf[SIZ]; - if (strlen(bstr("ok_button")) == 0) { + if (IsEmptyStr(bstr("ok_button"))) { display_main_menu(); return; } @@ -2258,22 +2348,23 @@ void display_zap(void) output_headers(1, 1, 2, 0, 0, 0); wprintf("
    \n"); - wprintf("
    "); - wprintf(""); + wprintf("

    "); wprintf(_("Zap (forget/unsubscribe) the current room")); - wprintf("\n"); - wprintf("

    \n"); - wprintf("
    \n
    \n"); + wprintf("\n"); + wprintf("
    \n"); + + wprintf("
    \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("", _("Zap this room")); + wprintf("\n"); + wprintf("\n", WC->nonce); + wprintf("", _("Zap this room")); wprintf(" "); - wprintf("", _("Cancel")); - wprintf("
    \n"); + wprintf("", _("Cancel")); + wprintf("\n"); wDumpContent(1); } @@ -2292,7 +2383,7 @@ void zap(void) */ strcpy(final_destination, WC->wc_roomname); - if (strlen(bstr("ok_button")) > 0) { + if (!IsEmptyStr(bstr("ok_button"))) { serv_printf("GOTO %s", WC->wc_roomname); serv_getln(buf, sizeof buf); if (buf[0] == '2') { @@ -2339,8 +2430,9 @@ void netedit(void) { char cmpa1[SIZ]; char cmpb0[SIZ]; char cmpb1[SIZ]; + int i, num_addrs; - if (strlen(bstr("line"))==0) { + if (IsEmptyStr(bstr("line"))) { display_editroom(); return; } @@ -2389,8 +2481,23 @@ void netedit(void) { serv_puts(buf); } - if (strlen(bstr("add_button")) > 0) { - serv_puts(line); + if (!IsEmptyStr(bstr("add_button"))) { + num_addrs = num_tokens(bstr("line"), ','); + if (num_addrs < 2) { + /* just adding one node or address */ + serv_puts(line); + } + else { + /* adding multiple addresses separated by commas */ + for (i=0; i"); + wprintf(""); } else if (fold[i].hasnewmsgs) { - wprintf(""); + wprintf(""); } else { - wprintf(""); + wprintf(""); } extract_token(buf, fold[i].name, levels-1, '|', sizeof buf); escputs(buf); - wprintf(""); + wprintf(""); wprintf("', "); if (has_subfolders) { @@ -2607,7 +2717,7 @@ void do_rooms_view(struct folder *fold, int max_folders, int num_floors) { if (boxes_per_column < 1) boxes_per_column = 1; /** Outer table (for columnization) */ - wprintf("" + wprintf("
    " "
    "); levels = 0; @@ -2619,7 +2729,7 @@ void do_rooms_view(struct folder *fold, int max_folders, int num_floors) { '|', sizeof floor_name); if ( (strcasecmp(floor_name, old_floor_name)) - && (strlen(old_floor_name) > 0) ) { + && (!IsEmptyStr(old_floor_name)) ) { /* End inner box */ do_template("endbox"); @@ -2635,7 +2745,7 @@ void do_rooms_view(struct folder *fold, int max_folders, int num_floors) { if (levels == 1) { /** Begin inner box */ - stresc(boxtitle, floor_name, 1, 0); + stresc(boxtitle, 256, floor_name, 1, 0); svprintf("BOXTITLE", WCS_STRING, boxtitle); do_template("beginbox"); } @@ -2654,14 +2764,14 @@ void do_rooms_view(struct folder *fold, int max_folders, int num_floors) { wprintf(""); } if (fold[i].hasnewmsgs) { - wprintf(""); + wprintf(""); } else { - wprintf(""); + wprintf(""); } extract_token(buf, fold[i].name, levels-1, '|', sizeof buf); escputs(buf); - wprintf(""); + wprintf(""); if (fold[i].selectable) { wprintf(""); } @@ -2677,7 +2787,7 @@ void do_rooms_view(struct folder *fold, int max_folders, int num_floors) { /** End the final inner box */ do_template("endbox"); - wprintf("
    \n"); + wprintf("\n"); } /** @@ -2719,7 +2829,7 @@ void do_iconbar_view(struct folder *fold, int max_folders, int num_floors) { '|', sizeof floor_name); if ( (strcasecmp(floor_name, old_floor_name)) - && (strlen(old_floor_name) > 0) ) { + && (!IsEmptyStr(old_floor_name)) ) { /** End inner box */ wprintf("
    \n"); wprintf("
    \n"); /** floordiv */ @@ -2728,7 +2838,7 @@ void do_iconbar_view(struct folder *fold, int max_folders, int num_floors) { if (levels == 1) { /** Begin floor */ - stresc(floordivtitle, floor_name, 0, 0); + stresc(floordivtitle, 256, floor_name, 0, 0); sprintf(floordiv_id, "floordiv%d", i); wprintf("" @@ -2779,17 +2889,17 @@ void do_iconbar_view(struct folder *fold, int max_folders, int num_floors) { wprintf(""); } if (fold[i].hasnewmsgs) { - wprintf(""); + wprintf(""); } else { - wprintf(""); + wprintf(""); } extract_token(buf, fold[i].name, levels-1, '|', sizeof buf); escputs(buf); if (!strcasecmp(fold[i].name, "My Folders|Mail")) { wprintf(" (INBOX)"); } - wprintf(""); + wprintf(""); if (fold[i].selectable) { wprintf(""); } @@ -2820,7 +2930,8 @@ void do_iconbar_view(struct folder *fold, int max_folders, int num_floors) { } wprintf("num_drop_targets = %d;\n", num_drop_targets); - if (strlen(WC->floordiv_expanded) > 1) { + if ((WC->floordiv_expanded[0] != '\0')&& + (WC->floordiv_expanded[1] != '\0')){ wprintf("which_div_expanded = '%s';\n", WC->floordiv_expanded); } @@ -2889,6 +3000,9 @@ void list_all_rooms_by_floor(char *viewpref) { ++num_floors; } + /** refresh the messages index for this room */ +// serv_puts("GOTO "); +// while (serv_getln(buf, sizeof buf), strcmp(buf, "000")); /** Now add rooms */ serv_puts("LKRA"); serv_getln(buf, sizeof buf); @@ -2982,7 +3096,7 @@ void knrooms(void) /** Determine whether the user is trying to change views */ if (bstr("view") != NULL) { - if (strlen(bstr("view")) > 0) { + if (!IsEmptyStr(bstr("view"))) { set_preference("roomlistview", bstr("view"), 1); } } @@ -2995,10 +3109,9 @@ void knrooms(void) } /** title bar */ - wprintf("
    \n" - "\n"); + wprintf("\n"); /** offer the ability to switch views */ - wprintf("
    " - "" - ); + wprintf("
    \n"); + wprintf("
    "); + wprintf("

    "); if (!strcasecmp(listviewpref, "rooms")) { wprintf(_("Room list")); } @@ -3008,32 +3121,35 @@ void knrooms(void) if (!strcasecmp(listviewpref, "table")) { wprintf(_("Room list")); } - wprintf("

    \n" - "\n"); - wprintf("\n", + "\n", ( !strcasecmp(listviewpref, "rooms") ? "SELECTED" : "" ) ); - wprintf("\n", + "\n", ( !strcasecmp(listviewpref, "folders") ? "SELECTED" : "" ) ); - wprintf("
    "); - offer_start_page(); - wprintf("
    \n"); - wprintf("
    \n" - "
    \n" - "
    \n"); + wprintf(""); + wprintf(""); + wprintf("
    \n"); + + wprintf("
    \n"); /** Display the room list in the user's preferred format */ list_all_rooms_by_floor(listviewpref); @@ -3048,7 +3164,7 @@ void knrooms(void) void set_room_policy(void) { char buf[SIZ]; - if (strlen(bstr("ok_button")) == 0) { + if (IsEmptyStr(bstr("ok_button"))) { strcpy(WC->ImportantMessage, _("Cancelled. Changes were not saved.")); display_editroom(); @@ -3069,5 +3185,4 @@ void set_room_policy(void) { display_editroom(); } - /*@}*/