[CONTROLLER][Feeds] Added should_format field on returned array

FeedController will only handle FormatNoteList if the should_format field is true.

This change was made to make the replies route feed possible, this route is added by the Conversation component. Since a reply isn't a conversation root, if the FeedController handled the FormatNoteList event, this feed wouldn't have any notes to display.
This commit is contained in:
2021-12-10 18:13:28 +00:00
parent 23f94ac961
commit 622057ba0d
4 changed files with 77 additions and 111 deletions

View File

@@ -48,9 +48,11 @@ abstract class FeedController extends Controller
Event::handle('FilterNoteList', [$actor, &$notes]);
}
$notes_out = null;
Event::handle('FormatNoteList', [$notes, &$notes_out]);
$result['notes'] = $notes_out;
if ($result['should_format'] ?? true) {
$notes_out = null;
Event::handle('FormatNoteList', [$notes, &$notes_out]);
$result['notes'] = $notes_out;
}
}
return $result;