forked from GNUsocial/gnu-social
[Note] Fix scope check for group notes, move away from SQL, to DQL
This commit is contained in:
parent
0b3ebf841d
commit
20901d26df
@ -267,11 +267,11 @@ class Note extends Entity
|
|||||||
&& null != DB::find('follow', ['follower' => $a->getId(), 'followed' => $this->gsactor_id]))
|
&& null != DB::find('follow', ['follower' => $a->getId(), 'followed' => $this->gsactor_id]))
|
||||||
|| ($scope->addressee
|
|| ($scope->addressee
|
||||||
&& null != DB::find('notification', ['activity_id' => $this->id, 'gsactor_id' => $a->getId()]))
|
&& null != DB::find('notification', ['activity_id' => $this->id, 'gsactor_id' => $a->getId()]))
|
||||||
|| ($scope->group
|
|| ($scope->group && [] != DB::dql('select m from group_member m ' .
|
||||||
&& [] != DB::sql('select m.gsactor_id from group_member m ' .
|
'join group_inbox i with m.group_id = i.group_id ' .
|
||||||
'inner join group_inbox i on m.group_id = i.group_id ' .
|
'join note n with i.activity_id = n.id ' .
|
||||||
'inner join note n on i.activity_id = n.id where n.id = :id',
|
'where n.id = :note_id and m.gsactor_id = :actor_id',
|
||||||
[], ['id' => $this->id]));
|
['note_id' => $this->id, 'actor_id' => $a->getId()]));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function jsonSerialize()
|
public function jsonSerialize()
|
||||||
|
Loading…
Reference in New Issue
Block a user