[ENTITY][Note] Include reply_to's targets in child's

This commit is contained in:
2021-12-26 06:50:36 +00:00
parent f5f7fc6056
commit 5e42723624
6 changed files with 42 additions and 15 deletions

View File

@@ -148,7 +148,7 @@ abstract class Entity
*
* @return array of ids of Actors
*/
public function getNotificationTargetIds(array $ids_already_known = [], ?int $sender_id = null): array
public function getNotificationTargetIds(array $ids_already_known = [], ?int $sender_id = null, bool $include_additional = true): array
{
// Additional actors that should know about this
if (array_key_exists('additional', $ids_already_known)) {
@@ -162,9 +162,9 @@ abstract class Entity
*
* @return array of Actors
*/
public function getNotificationTargets(array $ids_already_known = [], ?int $sender_id = null): array
public function getNotificationTargets(array $ids_already_known = [], ?int $sender_id = null, bool $include_additional = true): array
{
$target_ids = $this->getNotificationTargetIds($ids_already_known, $sender_id);
$target_ids = $this->getNotificationTargetIds($ids_already_known, $sender_id, $include_additional);
return $target_ids === [] ? [] : DB::findBy('actor', ['id' => $target_ids]);
}
}