mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-26 08:31:22 +01:00
Merge branch 'master' into develop
This commit is contained in:
@@ -130,7 +130,7 @@ module.exports = function (middleware) {
|
||||
return await user.getUserData(req.uid);
|
||||
}
|
||||
return {
|
||||
uid: 0,
|
||||
uid: req.uid === -1 ? -1 : 0,
|
||||
username: '[[global:guest]]',
|
||||
picture: user.getDefaultAvatar(),
|
||||
'icon:text': '?',
|
||||
@@ -184,7 +184,7 @@ module.exports = function (middleware) {
|
||||
timeagoCode: languages.userTimeagoCode(res.locals.config.userLang),
|
||||
browserTitle: translator.translate(controllersHelpers.buildTitle(title)),
|
||||
navigation: navigation.get(req.uid),
|
||||
roomIds: db.getSortedSetRevRange(`uid:${req.uid}:chat:rooms`, 0, 0),
|
||||
roomIds: req.uid > 0 ? db.getSortedSetRevRange(`uid:${req.uid}:chat:rooms`, 0, 0) : [],
|
||||
});
|
||||
|
||||
const unreadData = {
|
||||
|
||||
@@ -120,7 +120,9 @@ module.exports = function (User) {
|
||||
user.username = (user.hasOwnProperty('oldUid') && parseInt(user.oldUid, 10)) ? '[[global:former-user]]' : '[[global:guest]]';
|
||||
user.displayname = user.username;
|
||||
}
|
||||
|
||||
if (uid === -1) { // if loading spider set uid to -1 otherwise spiders have uid = 0 like guests
|
||||
user.uid = -1;
|
||||
}
|
||||
return user;
|
||||
});
|
||||
return users;
|
||||
|
||||
Reference in New Issue
Block a user