リプライ/メンションされていれば非フォロワーへのフォロワー限定でも参照可能に (#4033)
* 非メンション/リプライ投稿がmentionsにあるかどうかはvisibilityと関係ないので削除 * リプライ/メンションされていれば非フォロワーでも参照可能に
This commit is contained in:
@ -140,6 +140,12 @@ export const hideNote = async (packedNote: any, meId: mongo.ObjectID) => {
|
||||
hide = true;
|
||||
} else if (meId.equals(packedNote.userId)) {
|
||||
hide = false;
|
||||
} else if (packedNote.reply && meId.equals(packedNote.reply.userId)) {
|
||||
// 自分の投稿に対するリプライ
|
||||
hide = false;
|
||||
} else if (packedNote.mentions && packedNote.mentions.some((id: any) => meId.equals(id))) {
|
||||
// 自分へのメンション
|
||||
hide = false;
|
||||
} else {
|
||||
// フォロワーかどうか
|
||||
const following = await Following.findOne({
|
||||
|
@ -53,14 +53,23 @@ export default define(meta, (ps, user) => new Promise(async (res, rej) => {
|
||||
const visibleQuery = [{
|
||||
visibility: { $in: [ 'public', 'home' ] }
|
||||
}, {
|
||||
// myself (for specified/private)
|
||||
// myself (for followers/specified/private)
|
||||
userId: user._id
|
||||
}, {
|
||||
// to me (for specified)
|
||||
visibleUserIds: { $in: [ user._id ] }
|
||||
}, {
|
||||
visibility: 'followers',
|
||||
userId: { $in: followings.map(f => f.id) }
|
||||
$or: [{
|
||||
// フォロワーの投稿
|
||||
userId: { $in: followings.map(f => f.id) },
|
||||
}, {
|
||||
// 自分の投稿へのリプライ
|
||||
'_reply.userId': user._id,
|
||||
}, {
|
||||
// 自分へのメンションが含まれている
|
||||
mentions: { $in: [ user._id ] }
|
||||
}]
|
||||
}];
|
||||
|
||||
const query = {
|
||||
|
@ -51,14 +51,23 @@ export default define(meta, (ps, user) => new Promise(async (res, rej) => {
|
||||
}] : [{
|
||||
visibility: { $in: [ 'public', 'home' ] }
|
||||
}, {
|
||||
// myself (for specified/private)
|
||||
// myself (for followers/specified/private)
|
||||
userId: user._id
|
||||
}, {
|
||||
// to me (for specified)
|
||||
visibleUserIds: { $in: [ user._id ] }
|
||||
}, {
|
||||
visibility: 'followers',
|
||||
userId: { $in: followings.map(f => f.id) }
|
||||
$or: [{
|
||||
// フォロワーの投稿
|
||||
userId: { $in: followings.map(f => f.id) },
|
||||
}, {
|
||||
// 自分の投稿へのリプライ
|
||||
'_reply.userId': user._id,
|
||||
}, {
|
||||
// 自分へのメンションが含まれている
|
||||
mentions: { $in: [ user._id ] }
|
||||
}]
|
||||
}];
|
||||
|
||||
const q = {
|
||||
|
Reference in New Issue
Block a user