. // }}} /** * Handle network public feed * * @package GNUsocial * @category Controller * * @author Hugo Sales * @author Eliseu Amaro * @copyright 2020 Free Software Foundation, Inc http://www.fsf.org * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later */ namespace App\Controller; use App\Core\Controller; use App\Core\DB\DB; use App\Util\Common; use Symfony\Component\HttpFoundation\Request; class Network extends Controller { public function public(Request $request) { return [ '_template' => 'network/public.html.twig', 'notes' => DB::dql('select n from App\Entity\Note n ' . 'where n.reply_to is null order by n.created DESC'), ]; } public function home(Request $request) { return [ '_template' => 'network/public.html.twig', 'notes' => DB::dql('select n, g_inbox, g_member ' . 'from App\Entity\Note n inner join App\Entity\GroupInbox g_inbox inner join App\Entity\GroupMember g_member ' . 'with n.id = g_inbox.activity_id ' . 'order by n.created DESC' ), ]; } public function network(Request $request) { return [ '_template' => 'network/public.html.twig', 'notes' => DB::dql('select n from App\Entity\Note n ' . 'where n.scope = 1 ' . 'order by n.created DESC' ), ]; } public function replies(Request $request) { $actor_id = Common::ensureLoggedIn()->getActor()->getId(); return [ '_template' => 'network/public.html.twig', 'notes' => DB::dql('select n from App\Entity\Note n ' . 'where n.reply_to is not null and n.gsactor_id = ' . $actor_id . 'order by n.created DESC' ), ]; } }