Prevent private mail in message search results
This commit is contained in:
parent
837326e15a
commit
5c580c1ecd
|
@ -228,7 +228,8 @@ module.exports = class Message {
|
||||||
filter.extraFields = []
|
filter.extraFields = []
|
||||||
|
|
||||||
filter.privateTagUserId = <userId> - if set, only private messages belonging to <userId> are processed
|
filter.privateTagUserId = <userId> - if set, only private messages belonging to <userId> are processed
|
||||||
(any other areaTag or confTag filters will be ignored)
|
- any other areaTag or confTag filters will be ignored
|
||||||
|
- if NOT present, private areas are skipped
|
||||||
|
|
||||||
*=NYI
|
*=NYI
|
||||||
*/
|
*/
|
||||||
|
@ -303,12 +304,19 @@ module.exports = class Message {
|
||||||
} else {
|
} else {
|
||||||
if(filter.areaTag && filter.areaTag.length > 0) {
|
if(filter.areaTag && filter.areaTag.length > 0) {
|
||||||
if(Array.isArray(filter.areaTag)) {
|
if(Array.isArray(filter.areaTag)) {
|
||||||
const areaList = filter.areaTag.map(t => `"${t}"`).join(', ');
|
const areaList = filter.areaTag
|
||||||
|
.filter(t => t != Message.WellKnownAreaTags.Private)
|
||||||
|
.map(t => `"${t}"`).join(', ');
|
||||||
|
if(areaList.length > 0) {
|
||||||
appendWhereClause(`m.area_tag IN(${areaList})`);
|
appendWhereClause(`m.area_tag IN(${areaList})`);
|
||||||
} else if(_.isString(filter.areaTag)) {
|
}
|
||||||
|
} else if(_.isString(filter.areaTag) && Message.WellKnownAreaTags.Private !== filter.areaTag) {
|
||||||
appendWhereClause(`m.area_tag = "${filter.areaTag}"`);
|
appendWhereClause(`m.area_tag = "${filter.areaTag}"`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// explicit exclude of Private
|
||||||
|
appendWhereClause(`m.area_tag != "${Message.WellKnownAreaTags.Private}"`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_.isNumber(filter.replyToMessageId)) {
|
if(_.isNumber(filter.replyToMessageId)) {
|
||||||
|
|
Loading…
Reference in New Issue