Add new setting to disable posting of notification messages to file rooms.
authorWilfried Goesgens <willi@arangodb.com>
Sun, 13 Dec 2015 13:57:00 +0000 (14:57 +0100)
committerWilfried Goesgens <willi@arangodb.com>
Sun, 13 Dec 2015 13:57:00 +0000 (14:57 +0100)
citadel/modules/ctdlproto/serv_file.c
libcitadel/lib/libcitadel.h
webcit/roomops.c
webcit/static/t/room/edit/tab_config.html

index 50661c7..8a3bd5c 100644 (file)
@@ -557,14 +557,16 @@ void cmd_ucls(char *cmd)
                        fclose(fp);
                }
 
-               /* put together an upload notice */
-               snprintf(upload_notice, sizeof upload_notice,
-                       "NEW UPLOAD: '%s'\n %s\n%s\n",
-                        CC->upl_file, 
-                        CC->upl_comment, 
-                        CC->upl_mimetype);
-               quickie_message(CC->curr_user, NULL, NULL, CC->room.QRname,
-                               upload_notice, 0, NULL);
+               if ((CC->room.QRflags2 & QR2_NOUPLMSG) == 0) {
+                       /* put together an upload notice */
+                       snprintf(upload_notice, sizeof upload_notice,
+                                "NEW UPLOAD: '%s'\n %s\n%s\n",
+                                CC->upl_file, 
+                                CC->upl_comment, 
+                                CC->upl_mimetype);
+                       quickie_message(CC->curr_user, NULL, NULL, CC->room.QRname,
+                                       upload_notice, 0, NULL);
+               }
        } else {
                abort_upl(CC);
                cprintf("%d File '%s' aborted.\n", CIT_OK, CC->upl_path);
index 0dd4c76..9d251ad 100644 (file)
@@ -755,6 +755,7 @@ extern "C" {
 #define QR2_SUBJECTREQ 8               /* Subject strongly recommended */
 #define QR2_SMTP_PUBLIC        16              /* Listservice Subscribers may post */
 #define QR2_MODERATED  32              /* Listservice aide has to permit posts  */
+#define QR2_NOUPLMSG   64              /* If a file  is uploaded, no message will be posted.  */
 
 #define US_NEEDVALID   1               /* User needs to be validated       */
 #define US_EXTEDIT     2               /* Always use external editor       */
index bee589e..ae101ad 100644 (file)
@@ -39,7 +39,7 @@ ConstStr QR2FlagList[] = {
        {HKEY(strof(QR2_SUBJECTREQ))},
        {HKEY(strof(QR2_SMTP_PUBLIC))},
        {HKEY(strof(QR2_MODERATED))},
-       {HKEY("")}, 
+       {HKEY(strof(QR2_NOUPLMSG))}, 
        {HKEY("")}, 
        {HKEY("")}, 
        {HKEY("")}, 
@@ -806,6 +806,12 @@ void editroom(void)
                WCC->CurRoom.QRFlags &= ~QR_DOWNLOAD;
        }
 
+       if (yesbstr("ulmsg")) {
+               WCC->CurRoom.QRFlags2 |= QR2_NOUPLMSG;
+       } else {
+               WCC->CurRoom.QRFlags2 &= ~QR2_NOUPLMSG;
+       }
+
        if (yesbstr("visdir")) {
                WCC->CurRoom.QRFlags |= QR_VISDIR;
        } else {
@@ -1427,6 +1433,7 @@ InitModule_ROOMOPS
        REGISTERTokenParamDefine(QR2_SUBJECTREQ);
        REGISTERTokenParamDefine(QR2_SMTP_PUBLIC);
        REGISTERTokenParamDefine(QR2_MODERATED);
+       REGISTERTokenParamDefine(QR2_NOUPLMSG);
 
        REGISTERTokenParamDefine(UA_KNOWN);
        REGISTERTokenParamDefine(UA_GOTOALLOWED);
index 69026fd..b4b1055 100644 (file)
                                                <?%("COND:THISROOM:FLAG:QR", 17, #"QR_DOWNLOAD", 1, 'checked="checked" ', "")>  />
                                                <?_("Downloading allowed")>
                                        </li>
+                                       <li>
+                                               <input type="checkbox" name="ulmsg" value="yes" 
+                                               <?%("COND:THISROOM:FLAG:QR2", 17, #"QR2_NOUPLMSG", 1, 'checked="checked" ', "")>  />
+                                               <?_("Don't send message on upload")>
+                                       </li>
                                        <li>
                                                <input type="checkbox" name="visdir" value="yes" 
                                                <?%("COND:THISROOM:FLAG:QR", 18, #"QR_VISDIR", 1, 'checked="checked" ', "")>  />