From: Wilfried Goesgens Date: Sun, 13 Dec 2015 13:57:00 +0000 (+0100) Subject: Add new setting to disable posting of notification messages to file rooms. X-Git-Tag: Release_902~117 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=0d239d8372269d6567378f5c87f471d986ad3662 Add new setting to disable posting of notification messages to file rooms. --- diff --git a/citadel/modules/ctdlproto/serv_file.c b/citadel/modules/ctdlproto/serv_file.c index 50661c7c7..8a3bd5c82 100644 --- a/citadel/modules/ctdlproto/serv_file.c +++ b/citadel/modules/ctdlproto/serv_file.c @@ -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); diff --git a/libcitadel/lib/libcitadel.h b/libcitadel/lib/libcitadel.h index 0dd4c763c..9d251ad83 100644 --- a/libcitadel/lib/libcitadel.h +++ b/libcitadel/lib/libcitadel.h @@ -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 */ diff --git a/webcit/roomops.c b/webcit/roomops.c index bee589e4e..ae101adb8 100644 --- a/webcit/roomops.c +++ b/webcit/roomops.c @@ -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); diff --git a/webcit/static/t/room/edit/tab_config.html b/webcit/static/t/room/edit/tab_config.html index 69026fdd6..b4b1055a2 100644 --- a/webcit/static/t/room/edit/tab_config.html +++ b/webcit/static/t/room/edit/tab_config.html @@ -91,6 +91,11 @@ /> +
  • + /> + +
  • />