Another message area check

This commit is contained in:
Bryan Ashby 2019-09-09 21:44:03 -06:00
parent 24e18b5a7e
commit 8027a73ea5
No known key found for this signature in database
GPG Key ID: B49EB437951D2542
2 changed files with 12 additions and 3 deletions

View File

@ -404,8 +404,15 @@ function getMessageListForArea(client, areaTag, filter, cb)
Object.assign(filter, { areaTag } );
}
if(client) {
const area = getMessageAreaByTag(areaTag);
if(!client.acs.hasMessageAreaRead(area)) {
return cb(null, []);
}
}
if(Message.isPrivateAreaTag(areaTag)) {
filter.privateTagUserId = client.user.userId;
filter.privateTagUserId = client ? client.user.userId : 'INVALID_USER_ID';
}
return Message.findMessages(filter, cb);

View File

@ -130,9 +130,11 @@ function userLogin(client, username, password, options, cb) {
function postLoginPrep(client, cb) {
const defaultMsgAreaTag = (confTag) => {
return getDefaultMessageAreaTagByConfTag(client, confTag) ||
return (
getDefaultMessageAreaTagByConfTag(client, confTag) ||
getDefaultMessageAreaTagByConfTag(client, getDefaultMessageConferenceTag(client)) ||
'';
''
);
};
async.series(