* New room flag QR2_COLLABDEL ('collaborative
authorArt Cancro <ajc@citadel.org>
Wed, 28 Mar 2007 19:25:28 +0000 (19:25 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 28 Mar 2007 19:25:28 +0000 (19:25 +0000)
  deletion') to allow anyone with permission to post in a room,
  to also delete messages from the room.  Useful for collaborative
  public folders and the like.
* Bumped the version number to 7.07

citadel/citadel.c
citadel/citadel.h
citadel/citadel.nsi
citadel/citadel_ipc.c
citadel/citadel_ipc.h
citadel/configure.ac
citadel/ipcdef.h
citadel/messages.c
citadel/room_ops.c
citadel/rooms.c

index 0c5ccc835c4a26172f4d90a19abf88c6ddf9c8d7..b18eb2e92278070a5ebbf3976f333834c65a0a1f 100644 (file)
@@ -74,6 +74,7 @@ char fullname[USERNAME_SIZE];
 int screenwidth;
 int screenheight;
 unsigned room_flags;
+unsigned room_flags2;
 char room_name[ROOMNAMELEN];
 char *uglist[UGLISTLEN]; /* size of the ungoto list */
 long uglistlsn[UGLISTLEN]; /* current read position for all the ungoto's. Not going to make any friends with this one. */
@@ -431,6 +432,7 @@ void dotgoto(CtdlIPC *ipc, char *towhere, int display_name, int fromungoto)
        }
        safestrncpy(room_name, room->RRname, ROOMNAMELEN);
        room_flags = room->RRflags;
+       room_flags = room->RRflags2;
        from_floor = curr_floor;
        curr_floor = room->RRfloor;
 
index fbbbd44af4e7b9bd8b5d7a1b5b927c5f746002f1..4a993c1b9e13058c4ca1095743ca9e3b99387ccd 100644 (file)
@@ -47,7 +47,7 @@ extern "C" {
  * usually more strict because you're not really supposed to dump/load and
  * upgrade at the same time.
  */
-#define REV_LEVEL      706             /* This version */
+#define REV_LEVEL      707             /* This version */
 #define REV_MIN                591             /* Oldest compatible database */
 #define EXPORT_REV_MIN 706             /* Oldest compatible export files */
 
index 3a8590d58196d89c045b1009bbf4a1f2830000c0..2b3a257efd02a0b43cb6d78483082e08c3900d85 100644 (file)
@@ -4,7 +4,7 @@
 
 !include "${NSISDIR}\Contrib\Modern UI\System.nsh"
 !define MUI_PRODUCT "Citadel"
-!define MUI_VERSION "7.06"
+!define MUI_VERSION "7.07"
 !define MUI_WELCOMEPAGE
 !define MUI_LICENSEPAGE
 !define MUI_COMPONENTSPAGE
@@ -18,7 +18,7 @@
 ;!define MUI_ICON "${NSISDIR}\Contrib\Icons\modern-install.ico"
 ;!define MUI_UNICON "${NSISDIR}\Contrib\Icons\modern-uninstall.ico"
 
-OutFile "citadel-7.06.exe"
+OutFile "citadel-7.07.exe"
 BGGradient off
 
 LangString DESC_Citadel ${LANG_ENGLISH} "Citadel client and core libraries (required)"
index 9b9500267c2a4326af5505072eccf83a9c51cbae..af0fbb40eb2e62553318ec0a768562ccd2361f56 100644 (file)
@@ -408,6 +408,7 @@ int CtdlIPCGotoRoom(CtdlIPC *ipc, const char *room, const char *passwd,
                rret[0]->RRaide = extract_int(cret, 8);
                rret[0]->RRnewmail = extract_long(cret, 9);
                rret[0]->RRfloor = extract_int(cret, 10);
+               rret[0]->RRflags2 = extract_int(cret, 14);
        } else {
                free(*rret);
                *rret = NULL;
index d16689e20e76d488c5bffb95c77e12f7324deb0e..6d748d8e5a0e013693895ef07be2943f24ef564f 100644 (file)
@@ -93,6 +93,7 @@ struct ctdlipcroom {
        long RRtotal;                   /* Total number of messages in room */
        char RRinfoupdated;             /* Nonzero if info was updated */
        unsigned RRflags;               /* Various flags (see LKRN) */
+       unsigned RRflags2;              /* Various flags (see LKRN) */
        long RRhighest;                 /* Highest message number in room */
        long RRlastread;                /* Highest message user has read */
        char RRismailbox;               /* Is this room a mailbox room? */
index 8d5cab7e69b3f06e3acb1d59111a94e597fba47e..d8de6d92dbd7b8fde1b57d4abed134be4d205aa1 100644 (file)
@@ -1,7 +1,7 @@
 dnl Process this file with autoconf to produce a configure script.
 dnl $Id$
 AC_PREREQ(2.52)
-AC_INIT([Citadel], [7.06], [http://www.citadel.org/])
+AC_INIT([Citadel], [7.07], [http://www.citadel.org/])
 AC_REVISION([$Revision$])
 AC_CONFIG_SRCDIR([citserver.c])
 AC_PREFIX_DEFAULT(/usr/local/citadel)
index e3f8a374b2fc285516b357e2eb1cc670332545bf..968be0134fb551290b19198a1dc9b84955da7e01 100644 (file)
@@ -55,6 +55,7 @@ extern "C" {
 
 #define QR2_SYSTEM     1               /* System room; hide by default     */
 #define QR2_SELFLIST   2               /* Self-service mailing list mgmt   */
+#define QR2_COLLABDEL  4               /* Anyone who can post can delete   */
 
 #define US_NEEDVALID   1               /* User needs to be validated       */
 #define US_EXTEDIT     2               /* Always use external editor       */
index d26508ea506741e7c708f2b0b140e053b7fa5d76..481d76075523e5741a47fe386b8115703fb84416 100644 (file)
@@ -71,6 +71,7 @@ int num_msgs;
 char rc_alt_semantics;
 extern char room_name[];
 extern unsigned room_flags;
+extern unsigned room_flags2;
 extern long highest_msg_read;
 extern char temp[];
 extern char temp2[];
@@ -1652,9 +1653,10 @@ RMSGREAD:        scr_flush();
 /* space key same as <N> */ if (e == 32)
                                        e = 'n';
 /* del/move for aides only */
-                                   if ((!is_room_aide)
-                                       && ((room_flags & QR_MAILBOX) ==
-                                           0)) {
+                                   if (  (!is_room_aide)
+                                      && ((room_flags & QR_MAILBOX) == 0)
+                                      && ((room_flags2 & QR2_COLLABDEL) == 0)
+                                      ) {
                                        if ((e == 'd') || (e == 'm'))
                                                e = 0;
                                }
@@ -1742,8 +1744,10 @@ RMSGREAD:        scr_flush();
                                " N  Next (continue with next message)\n"
                                " Y  My Next (continue with next message you authored)\n"
                                " B  Back (go back to previous message)\n");
-                       if ((is_room_aide)
-                           || (room_flags & QR_MAILBOX)) {
+                       if (  (is_room_aide)
+                          || (room_flags & QR_MAILBOX)
+                          || (room_flags2 & QR2_COLLABDEL)
+                       ) {
                                scr_printf(" D  Delete this message\n"
                                        " M  Move message to another room\n");
                        }
index 8174dc97833b485950a786a05e1fbf3d99ed2b34..ffe2078f993ba8f4cd613272f2eea87d76225518 100644 (file)
@@ -44,7 +44,7 @@
 struct floor *floorcache[MAXFLOORS];
 
 /*
- * Generic routine for determining user access to rooms
+ * Retrieve access control information for any user/room pair
  */
 void CtdlRoomAccess(struct ctdlroom *roombuf, struct ctdluser *userbuf,
                int *result, int *view)
@@ -131,6 +131,15 @@ void CtdlRoomAccess(struct ctdlroom *roombuf, struct ctdluser *userbuf,
                        retval = retval | UA_POSTALLOWED;
                }
 
+               /* If "collaborative deletion" is active for this room, any user who can post
+                * is also allowed to delete
+                */
+               if (CC->room.QRflags2 & QR2_COLLABDEL) {
+                       if (retval & UA_POSTALLOWED) {
+                               retval = retval | UA_DELETEALLOWED;
+                       }
+               }
+
        }
 
        /* Check to see if the user has forgotten this room */
@@ -919,7 +928,7 @@ void usergoto(char *where, int display_result, int transiently,
        CC->curr_view = (int)vbuf.v_view;
 
        if (display_result) {
-               cprintf("%d%c%s|%d|%d|%d|%d|%ld|%ld|%d|%d|%d|%d|%d|%d|%d|\n",
+               cprintf("%d%c%s|%d|%d|%d|%d|%ld|%ld|%d|%d|%d|%d|%d|%d|%d|%d|\n",
                        CIT_OK, CtdlCheckExpress(),
                        truncated_roomname,
                        (int)new_messages,
@@ -934,7 +943,8 @@ void usergoto(char *where, int display_result, int transiently,
                        (int)CC->room.QRfloor,
                        (int)vbuf.v_view,
                        (int)CC->room.QRdefaultview,
-                       (int)is_trash
+                       (int)is_trash,
+                       (int)CC->room.QRflags2
                );
        }
 }
index c7b2390806450ee09c21f857b7be95551db02d15..034e3be910ec59b47f9a3574be60cab1a9ccd1cf 100644 (file)
@@ -568,10 +568,13 @@ void editthisroom(CtdlIPC *ipc)
                                        "Preferred users only", QR_PREFONLY);
        attr->QRflags = set_room_attr(ipc, attr->QRflags,
                                        "Read-only room", QR_READONLY);
-       attr->QRflags = set_room_attr(ipc, attr->QRflags,
-                                       "Directory room", QR_DIRECTORY);
+       attr->QRflags2 = set_room_attr(ipc, attr->QRflags2,
+                               "Allow message deletion by anyone who can post",
+                               QR2_COLLABDEL);
        attr->QRflags = set_room_attr(ipc, attr->QRflags,
                                        "Permanent room", QR_PERMANENT);
+       attr->QRflags = set_room_attr(ipc, attr->QRflags,
+                                       "Directory room", QR_DIRECTORY);
        if (attr->QRflags & QR_DIRECTORY) {
                strprompt("Directory name", attr->QRdirname, 14);
                attr->QRflags =
@@ -597,7 +600,7 @@ void editthisroom(CtdlIPC *ipc)
                                       "Ask users whether to make messages anonymous",
                                       QR_ANONOPT);
        }
-       attr->QRorder = intprompt("Listing order", attr->QRorder, 1, 127);
+       attr->QRorder = intprompt("Listing order", attr->QRorder, 0, 127);
 
        /* Ask about the room aide */
        do {