mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-05 12:01:17 +01:00
closes #5140
This commit is contained in:
@@ -301,6 +301,10 @@ app.cacheBuster = null;
|
||||
return app.alertError('[[error:not-logged-in]]');
|
||||
}
|
||||
|
||||
if (parseInt(touid, 10) === parseInt(app.user.uid, 10)) {
|
||||
return app.alertError('[[error:cant-chat-with-yourself]]');
|
||||
}
|
||||
|
||||
socket.emit('modules.chats.newRoom', {touid: touid}, function (err, roomId) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
|
||||
@@ -41,7 +41,11 @@ define('forum/chats/search', ['components'], function (components) {
|
||||
|
||||
function displayResults(chatsListEl, data) {
|
||||
chatsListEl.empty();
|
||||
|
||||
|
||||
data.users = data.users.filter(function (user) {
|
||||
return parseInt(user.uid, 10) !== parseInt(app.user.uid, 10);
|
||||
});
|
||||
|
||||
if (!data.users.length) {
|
||||
return chatsListEl.translateHtml('<li><div><span>[[users:no-users-found]]</span></div></li>');
|
||||
}
|
||||
|
||||
@@ -367,6 +367,10 @@ var userNotifications = require('./user/notifications');
|
||||
return callback(new Error('[[error:chat-disabled]]'));
|
||||
}
|
||||
|
||||
if (parseInt(uid, 10) === parseInt(toUid, 10)) {
|
||||
return callback(new Error('[[error:cant-chat-with-yourself'));
|
||||
}
|
||||
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
user.exists(toUid, next);
|
||||
|
||||
Reference in New Issue
Block a user