. // }}} /** * Handle network public feed * * @package GNUsocial * @category Controller * * @author Hugo Sales * @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 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) { $notes = DB::dql( 'select n from ( ( select note.id from App\Entity\Note inner join App\Entity\Follow with note.id = follow.followed ) union all ( select note.id from App\Entity\Note with note.id = note.reply_to ) union all ( select note.id from App\Entity\Note inner join App\Entity\GroupInbox with note.id = group_inbox.activity_id inner join App\Entity\GroupMember where group_inbox.group_id = group_member.group_id ) ) n ' . 'order by n.created DESC' ); return [ '_template' => 'network/public.html.twig', 'notes' => $notes, ]; } }