mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-05 20:11:26 +01:00
closes #3595
This commit is contained in:
@@ -100,6 +100,8 @@
|
||||
"cant-chat-with-yourself": "You can't chat with yourself!",
|
||||
"chat-restricted": "This user has restricted their chat messages. They must follow you before you can chat with them",
|
||||
"too-many-messages": "You have sent too many messages, please wait awhile.",
|
||||
"invalid-chat-message": "Invalid chat message",
|
||||
"chat-message-too-long": "Chat message is too long",
|
||||
|
||||
"reputation-system-disabled": "Reputation system is disabled.",
|
||||
"downvoting-disabled": "Downvoting is disabled",
|
||||
|
||||
@@ -28,8 +28,6 @@ var db = require('./database'),
|
||||
}
|
||||
|
||||
Messaging.addMessage = function(fromuid, touid, content, timestamp, callback) {
|
||||
var uids = sortUids(fromuid, touid);
|
||||
|
||||
if (typeof timestamp === 'function') {
|
||||
callback = timestamp;
|
||||
timestamp = Date.now();
|
||||
@@ -37,6 +35,16 @@ var db = require('./database'),
|
||||
timestamp = timestamp || Date.now();
|
||||
}
|
||||
|
||||
if (!content) {
|
||||
return callback(new Error('[[error:invalid-chat-message]]'));
|
||||
}
|
||||
|
||||
if (content.length > (meta.config.maximumChatMessageLength || 1000)) {
|
||||
return callback(new Error('[[error:chat-message-too-long]]'));
|
||||
}
|
||||
|
||||
var uids = sortUids(fromuid, touid);
|
||||
|
||||
db.incrObjectField('global', 'nextMid', function(err, mid) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
|
||||
@@ -182,6 +182,7 @@
|
||||
<li><a href="{relative_path}/admin/settings/group">Group</a></li>
|
||||
<li><a href="{relative_path}/admin/settings/guest">Guests</a></li>
|
||||
<li><a href="{relative_path}/admin/settings/post">Post</a></li>
|
||||
<li><a href="{relative_path}/admin/settings/chat">Chat</a></li>
|
||||
<li><a href="{relative_path}/admin/settings/pagination">Pagination</a></li>
|
||||
<li><a href="{relative_path}/admin/settings/tags">Tags</a></li>
|
||||
<li><a href="{relative_path}/admin/settings/notifications">Notifications</a></li>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
<div class="form-group">
|
||||
<label>Maximum length of chat messages</label>
|
||||
<input type="text" class="form-control" value="1000" data-field="maximumChatLength">
|
||||
<input type="text" class="form-control" value="1000" data-field="maximumChatMessageLength">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -114,15 +114,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-2 col-xs-12 settings-header">Chat Settings</div>
|
||||
<div class="col-sm-10 col-xs-12">
|
||||
<form>
|
||||
<strong>Chat Message Inbox Size</strong><br /> <input type="text" class="form-control" value="250" data-field="chatMessageInboxSize">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-2 col-xs-12 settings-header">Upload Settings</div>
|
||||
<div class="col-sm-10 col-xs-12">
|
||||
|
||||
Reference in New Issue
Block a user