mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 04:25:55 +01:00
fixes #3313
This commit is contained in:
@@ -490,6 +490,13 @@ accountsController.getChats = function(req, res, next) {
|
|||||||
if (parseInt(meta.config.disableChat) === 1) {
|
if (parseInt(meta.config.disableChat) === 1) {
|
||||||
return helpers.notFound(req, res);
|
return helpers.notFound(req, res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// In case a userNAME is passed in instead of a slug, the route should not 404
|
||||||
|
var slugified = utils.slugify(req.params.userslug);
|
||||||
|
if (req.params.userslug !== slugified) {
|
||||||
|
return res.redirect(nconf.get('relative_path') + '/chats/' + slugified);
|
||||||
|
}
|
||||||
|
|
||||||
async.parallel({
|
async.parallel({
|
||||||
contacts: async.apply(user.getFollowing, req.user.uid, 0, 19),
|
contacts: async.apply(user.getFollowing, req.user.uid, 0, 19),
|
||||||
recentChats: async.apply(messaging.getRecentChats, req.user.uid, 0, 19)
|
recentChats: async.apply(messaging.getRecentChats, req.user.uid, 0, 19)
|
||||||
|
|||||||
Reference in New Issue
Block a user