[PLUGINS][Reply] Fix return on getReplyToNote
The array contained an object, the result was within that object and not the object itself.
This commit is contained in:
@@ -32,7 +32,7 @@ class TreeNotes extends Plugin
|
||||
*/
|
||||
public function onFormatNoteList(array $notes_in, ?array &$notes_out)
|
||||
{
|
||||
$roots = array_filter($notes_in, fn (Note $note) => NoteReply::getReplyToNote($note) == null);
|
||||
$roots = array_filter($notes_in, fn (Note $note) => \is_null(NoteReply::getReplyToNote($note)));
|
||||
$notes_out = $this->build_tree($roots, $notes_in);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ class TreeNotes extends Plugin
|
||||
|
||||
private function build_subtree(Note $parent, array $notes)
|
||||
{
|
||||
$children = array_filter($notes, fn (Note $note) => $parent->getId() == NoteReply::getReplyToNote($note));
|
||||
$children = array_filter($notes, fn (Note $note) => $parent->getId() === NoteReply::getReplyToNote($note));
|
||||
return ['note' => $parent, 'replies' => $this->build_tree($children, $notes)];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user