mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: don't return promise
This commit is contained in:
@@ -38,7 +38,8 @@ SocketGroups.join = function (socket, data, callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!meta.config.allowPrivateGroups) {
|
if (!meta.config.allowPrivateGroups) {
|
||||||
return groups.join(data.groupName, socket.uid, callback);
|
groups.join(data.groupName, socket.uid, callback);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
async.parallel({
|
async.parallel({
|
||||||
|
|||||||
@@ -93,7 +93,8 @@ module.exports = function (SocketTopics) {
|
|||||||
};
|
};
|
||||||
if (data.sort === 'unread') {
|
if (data.sort === 'unread') {
|
||||||
params.cid = data.cid;
|
params.cid = data.cid;
|
||||||
return topics.getUnreadTopics(params, callback);
|
topics.getUnreadTopics(params, callback);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
params.cids = data.cid;
|
params.cids = data.cid;
|
||||||
params.sort = data.sort;
|
params.sort = data.sort;
|
||||||
|
|||||||
@@ -130,13 +130,12 @@ module.exports = function (SocketUser) {
|
|||||||
db.setObjectField('uid:' + uid + ':ban:' + banData.timestamp, 'fromUid', callerUid, next);
|
db.setObjectField('uid:' + uid + ':ban:' + banData.timestamp, 'fromUid', callerUid, next);
|
||||||
},
|
},
|
||||||
function (next) {
|
function (next) {
|
||||||
if (!reason) {
|
if (reason) {
|
||||||
return translator.translate('[[user:info.banned-no-reason]]', function (translated) {
|
return next(null, reason);
|
||||||
|
}
|
||||||
|
translator.translate('[[user:info.banned-no-reason]]', function (translated) {
|
||||||
next(null, translated);
|
next(null, translated);
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
next(null, reason);
|
|
||||||
},
|
},
|
||||||
function (_reason, next) {
|
function (_reason, next) {
|
||||||
websockets.in('uid_' + uid).emit('event:banned', {
|
websockets.in('uid_' + uid).emit('event:banned', {
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ describe('socket.io', function () {
|
|||||||
it('should get more unread topics', function (done) {
|
it('should get more unread topics', function (done) {
|
||||||
io.emit('topics.loadMoreSortedTopics', { after: 0, count: 10, direction: 1, sort: 'unread' }, function (err, result) {
|
io.emit('topics.loadMoreSortedTopics', { after: 0, count: 10, direction: 1, sort: 'unread' }, function (err, result) {
|
||||||
assert.ifError(err);
|
assert.ifError(err);
|
||||||
console.log(result);
|
assert(Array.isArray(result.topics));
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user