forked from GNUsocial/gnu-social
[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']);
|
||||
}
|
||||
|
||||
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
|
||||
|
@ -350,7 +350,7 @@ class Note extends Entity
|
||||
{
|
||||
$rendered = null;
|
||||
$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 = [];
|
||||
foreach ($mentions as $mention) {
|
||||
foreach ($mention['mentioned'] as $m) {
|
||||
|
Loading…
Reference in New Issue
Block a user