[COMPONENT][Notification] Support empty array of targets
This commit is contained in:
parent
b89f57ce93
commit
60d31e097e
@ -187,7 +187,8 @@ class Activity extends Entity
|
|||||||
array_push($target_ids, ...$ids_already_known['additional']);
|
array_push($target_ids, ...$ids_already_known['additional']);
|
||||||
}
|
}
|
||||||
|
|
||||||
return DB::findBy('actor', ['id' => array_unique($target_ids)]);
|
$target_ids = array_unique($target_ids);
|
||||||
|
return $target_ids === [] ? [] : DB::findBy('actor', ['id' => $target_ids]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function schemaDef(): array
|
public static function schemaDef(): array
|
||||||
|
@ -350,7 +350,7 @@ class Note extends Entity
|
|||||||
{
|
{
|
||||||
$rendered = null;
|
$rendered = null;
|
||||||
$mentions = [];
|
$mentions = [];
|
||||||
Event::handle('RenderNoteContent', [$this->getContent(), $this->getContentType(), &$rendered, &$mentions, $this->getActor(), Language::getById($this->getLanguageId())->getLocale()]);
|
Event::handle('RenderNoteContent', [$this->getContent(), $this->getContentType(), &$rendered, $this->getActor(), Language::getById($this->getLanguageId())->getLocale(), &$mentions]);
|
||||||
$mentioned = [];
|
$mentioned = [];
|
||||||
foreach ($mentions as $mention) {
|
foreach ($mentions as $mention) {
|
||||||
foreach ($mention['mentioned'] as $m) {
|
foreach ($mention['mentioned'] as $m) {
|
||||||
|
Loading…
Reference in New Issue
Block a user