. // }}} /** * Base class for feed controllers * * @package GNUsocial * @category Controller * * @author Hugo Sales * @copyright 2021 Free Software Foundation, Inc http://www.fsf.org * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later */ namespace App\Core\Controller; use App\Core\Controller; use App\Core\Event; use App\Util\Common; abstract class FeedController extends Controller { public static function post_process(array $result) { $actor = Common::actor(); if (\array_key_exists('notes', $result)) { $notes = $result['notes']; if (!\is_null($actor)) { Event::handle('FilterNoteList', [$actor, &$notes]); } if ($result['should_format'] ?? true) { $notes_out = null; Event::handle('FormatNoteList', [$notes, &$notes_out]); $result['notes'] = $notes_out; } } return $result; } }