]> code.citadel.org Git - citadel.git/blobdiff - citadel/rooms.c
Create some directories to hold the source files for the utility
[citadel.git] / citadel / rooms.c
index 1226455c3afd25202991f9f98060dbba4870e8f4..5fbc76c7f78c210fd8b7657d2c26fd8eddf2aa9a 100644 (file)
 #include <sys/wait.h>
 #include <errno.h>
 #include <stdarg.h>
+#include <libcitadel.h>
 #include "citadel.h"
 #include "citadel_ipc.h"
 #include "citadel_decls.h"
 #include "rooms.h"
 #include "commands.h"
-#include "tools.h"
 #include "messages.h"
 #ifndef HAVE_SNPRINTF
 #include "snprintf.h"
@@ -534,7 +534,7 @@ void editthisroom(CtdlIPC *ipc)
        attr->QRflags = set_room_attr(ipc, attr->QRflags, "Private room", QR_PRIVATE);
        if (attr->QRflags & QR_PRIVATE) {
                attr->QRflags = set_room_attr(ipc, attr->QRflags,
-                                      "Accessible by guessing room name",
+                                      "Hidden room (accessible to anyone who knows the room name)",
                                       QR_GUESSNAME);
        }
 
@@ -596,6 +596,12 @@ void editthisroom(CtdlIPC *ipc)
        attr->QRflags2 = set_room_attr(ipc, attr->QRflags2,
                                "Self-service list subscribe/unsubscribe",
                                QR2_SELFLIST);
+       attr->QRflags2 = set_room_attr(ipc, attr->QRflags2,
+                               "public posting to this room via room_roomname@yourcitadel.org",
+                               QR2_SMTP_PUBLIC);
+       attr->QRflags2 = set_room_attr(ipc, attr->QRflags2,
+                               "moderated mailinglist",
+                               QR2_MODERATED);
        attr->QRflags = set_room_attr(ipc, attr->QRflags,
                               "Automatically make all messages anonymous",
                               QR_ANONONLY);
@@ -619,11 +625,6 @@ void editthisroom(CtdlIPC *ipc)
                }
        } while (r / 100 != 2);
 
-       /* FIXME: Duplicate code??? */
-       if (!strcasecmp(raide, "none")) {
-               strcpy(raide, "");
-       }
-
        /* Angels and demons dancing in my head... */
        do {
                snprintf(buf, sizeof buf, "%d", attr->QRep.expire_mode);
@@ -844,6 +845,7 @@ void download(CtdlIPC *ipc, int proto)
        FILE *tpipe = NULL;
        int broken = 0;
        int r;
+       int rv = 0;
        void *file = NULL;      /* The downloaded file */
        size_t filelen = 0L;    /* The downloaded file length */
 
@@ -904,7 +906,7 @@ void download(CtdlIPC *ipc, int proto)
 
        screen_reset();
        stty_ctdl(SB_RESTORE);
-       system(transmit_cmd);
+       rv = system(transmit_cmd);
        stty_ctdl(SB_NO_INTR);
        screen_set();
 
@@ -922,6 +924,7 @@ void roomdir(CtdlIPC *ipc)
        char flnm[256];
        char flsz[32];
        char comment[256];
+       char mimetype[256];
        char buf[256];
        char *listing = NULL;   /* Returned directory listing */
        int r;
@@ -942,12 +945,13 @@ void roomdir(CtdlIPC *ipc)
 
                extract_token(flnm, buf, 0, '|', sizeof flnm);
                extract_token(flsz, buf, 1, '|', sizeof flsz);
-               extract_token(comment, buf, 2, '|', sizeof comment);
+               extract_token(mimetype, buf, 2, '|', sizeof mimetype);
+               extract_token(comment, buf, 3, '|', sizeof comment);
                if (strlen(flnm) <= 14)
-                       pprintf("%-14s %8s %s\n", flnm, flsz, comment);
+                       pprintf("%-14s %8s %s [%s]\n", flnm, flsz, comment, mimetype);
                else
-                       pprintf("%s\n%14s %8s %s\n", flnm, "", flsz,
-                               comment);
+                       pprintf("%s\n%14s %8s %s [%s]\n", flnm, "", flsz,
+                               comment, mimetype);
        }
        if (listing) free(listing);
 }
@@ -1057,7 +1061,7 @@ void entroom(CtdlIPC *ipc)
        if (IsEmptyStr(new_room_name)) {
                return;
        }
-       for (a = 0; a < strlen(new_room_name); ++a) {
+       for (a = 0; !IsEmptyStr(&new_room_name[a]); ++a) {
                if (new_room_name[a] == '|') {
                        new_room_name[a] = '_';
                }
@@ -1067,10 +1071,14 @@ void entroom(CtdlIPC *ipc)
 
        IFNEXPERT formout(ipc, "roomaccess");
        do {
-               scr_printf("<?>Help\n<1>Public room\n<2>Guess-name room\n"
-                      "<3>Passworded room\n<4>Invitation-only room\n"
-                      "<5>Personal room\n"
-                       "Enter room type: ");
+               scr_printf("<?>Help\n"
+                       "<1>Public room (shown to all users by default)\n"
+                       "<2>Hidden room (accessible to anyone who knows the room name)\n"
+                       "<3>Passworded room (hidden, plus requires a password to enter)\n"
+                       "<4>Invitation-only room (requires access to be granted by an Aide)\n"
+                       "<5>Personal room (accessible to you only)\n"
+                       "Enter room type: "
+               );
                do {
                        b = inkey();
                } while (((b < '1') || (b > '5')) && (b != '?'));
@@ -1084,7 +1092,7 @@ void entroom(CtdlIPC *ipc)
        new_room_type = b - 1;
        if (new_room_type == 2) {
                newprompt("Enter a room password: ", new_room_pass, 9);
-               for (a = 0; a < strlen(new_room_pass); ++a)
+               for (a = 0; !IsEmptyStr(&new_room_pass[a]); ++a)
                        if (new_room_pass[a] == '|')
                                new_room_pass[a] = '_';
        } else {
@@ -1095,7 +1103,7 @@ void entroom(CtdlIPC *ipc)
        if (b == 1)
                scr_printf(" public room.");
        if (b == 2)
-               scr_printf(" guess-name room.");
+               scr_printf(" hidden room.");
        if (b == 3)
                scr_printf(" passworded room, password: %s", new_room_pass);
        if (b == 4)