Commit 5a175f81 authored by Barış Soner Uşaklı's avatar Barış Soner Uşaklı
Browse files

fix: #500, dont load loggedInUser if quickreply isnt enabled

parent 41e4cfb8
......@@ -68,18 +68,22 @@ function renderAdmin(req, res, next) {
}
library.addUserToTopic = async function (hookData) {
if (hookData.req.user) {
const userData = await user.getUserData(hookData.req.user.uid);
hookData.templateData.loggedInUser = userData;
} else {
hookData.templateData.loggedInUser = {
uid: 0,
username: '[[global:guest]]',
picture: user.getDefaultAvatar(),
'icon:text': '?',
'icon:bgColor': '#aaa',
};
const settings = await meta.settings.get('persona');
if (settings.enableQuickReply === 'on') {
if (hookData.req.user) {
const userData = await user.getUserData(hookData.req.user.uid);
hookData.templateData.loggedInUser = userData;
} else {
hookData.templateData.loggedInUser = {
uid: 0,
username: '[[global:guest]]',
picture: user.getDefaultAvatar(),
'icon:text': '?',
'icon:bgColor': '#aaa',
};
}
}
return hookData;
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment