mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 11:35:55 +01:00
introducing option to disable chat message editing/deletion
This commit is contained in:
@@ -62,8 +62,8 @@
|
||||
"nodebb-plugin-spam-be-gone": "0.4.10",
|
||||
"nodebb-rewards-essentials": "0.0.9",
|
||||
"nodebb-theme-lavender": "3.0.15",
|
||||
"nodebb-theme-persona": "4.1.67",
|
||||
"nodebb-theme-vanilla": "5.1.45",
|
||||
"nodebb-theme-persona": "4.1.68",
|
||||
"nodebb-theme-vanilla": "5.1.46",
|
||||
"nodebb-widget-essentials": "2.0.12",
|
||||
"nodemailer": "2.6.4",
|
||||
"nodemailer-sendmail-transport": "1.0.0",
|
||||
|
||||
@@ -42,6 +42,7 @@ apiController.getConfig = function (req, res, next) {
|
||||
config.allowTopicsThumbnail = parseInt(meta.config.allowTopicsThumbnail, 10) === 1;
|
||||
config.usePagination = parseInt(meta.config.usePagination, 10) === 1;
|
||||
config.disableChat = parseInt(meta.config.disableChat, 10) === 1;
|
||||
config.disableChatMessageEditing = parseInt(meta.config.disableChatMessageEditing, 10) === 1;
|
||||
config.socketioTransports = nconf.get('socket.io:transports') || ['polling', 'websocket'];
|
||||
config.websocketAddress = nconf.get('socket.io:address') || '';
|
||||
config.maxReconnectionAttempts = meta.config.maxReconnectionAttempts || 5;
|
||||
|
||||
@@ -45,7 +45,9 @@ module.exports = function (Messaging) {
|
||||
};
|
||||
|
||||
Messaging.canEdit = function (messageId, uid, callback) {
|
||||
if (parseInt(meta.config.disableChat) === 1) {
|
||||
if (parseInt(meta.config.disableChat, 10) === 1) {
|
||||
return callback(null, false);
|
||||
} else if (parseInt(meta.config.disableChatMessageEditing, 10) === 1) {
|
||||
return callback(null, false);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,16 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
|
||||
<input type="checkbox" class="mdl-switch__input" id="disableChatMessageEditing" data-field="disableChatMessageEditing">
|
||||
<span class="mdl-switch__label"><strong>Disable chat message editing/deletion</strong></span>
|
||||
</label>
|
||||
</div>
|
||||
<p class="help-block">Administrators and global moderators are exempt from this restriction</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Maximum length of chat messages</label>
|
||||
<input type="text" class="form-control" value="1000" data-field="maximumChatMessageLength">
|
||||
|
||||
Reference in New Issue
Block a user