[COMPONENT][Feed] Correct queries and introduce new feeds
Refactor feeds and search to use a common query builder
This commit is contained in:
@@ -47,7 +47,7 @@ class Conversation extends FeedController
|
||||
. 'on n.conversation_id = :id '
|
||||
. 'order by n.created DESC', ['id' => $conversation_id], );
|
||||
return [
|
||||
'_template' => 'feeds/feed.html.twig',
|
||||
'_template' => 'feed/feed.html.twig',
|
||||
'notes' => $notes,
|
||||
'should_format' => false,
|
||||
'page_title' => 'Conversation',
|
||||
|
@@ -77,7 +77,7 @@ class Reply extends FeedController
|
||||
. 'where n.reply_to is not null and n.actor_id = :id '
|
||||
. 'order by n.created DESC', ['id' => $actor_id], );
|
||||
return [
|
||||
'_template' => 'feeds/feed.html.twig',
|
||||
'_template' => 'feed/feed.html.twig',
|
||||
'notes' => $notes,
|
||||
'should_format' => false,
|
||||
'page_title' => 'Replies feed',
|
||||
|
122
components/Feed/Feed.php
Normal file
122
components/Feed/Feed.php
Normal file
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types = 1);
|
||||
|
||||
// {{{ License
|
||||
|
||||
// This file is part of GNU social - https://www.gnu.org/software/social
|
||||
//
|
||||
// GNU social is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// GNU social is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with GNU social. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
// }}}
|
||||
|
||||
namespace Component\Feed;
|
||||
|
||||
use App\Core\DB\DB;
|
||||
use App\Core\Event;
|
||||
use App\Core\Modules\Component;
|
||||
use App\Entity\Actor;
|
||||
use App\Util\Formatting;
|
||||
use Component\Search\Util\Parser;
|
||||
use Doctrine\Common\Collections\ExpressionBuilder;
|
||||
|
||||
class Feed extends Component
|
||||
{
|
||||
public static function query(string $query, int $page, ?string $language = null): array
|
||||
{
|
||||
$note_criteria = null;
|
||||
$actor_criteria = null;
|
||||
if (!empty($query = trim($query))) {
|
||||
[$note_criteria, $actor_criteria] = Parser::parse($query, $language);
|
||||
}
|
||||
$note_qb = DB::createQueryBuilder();
|
||||
$actor_qb = DB::createQueryBuilder();
|
||||
$note_qb->select('note')->from('App\Entity\Note', 'note')->orderBy('note.created', 'DESC')->orderBy('note.id', 'DESC');
|
||||
$actor_qb->select('actor')->from('App\Entity\Actor', 'actor')->orderBy('actor.created', 'DESC')->orderBy('actor.id', 'DESC');
|
||||
Event::handle('SearchQueryAddJoins', [&$note_qb, &$actor_qb, $note_criteria, $actor_criteria]);
|
||||
|
||||
$notes = [];
|
||||
$actors = [];
|
||||
if (!\is_null($note_criteria)) {
|
||||
$note_qb->addCriteria($note_criteria);
|
||||
}
|
||||
$notes = $note_qb->getQuery()->execute();
|
||||
|
||||
if (!\is_null($actor_criteria)) {
|
||||
$actor_qb->addCriteria($actor_criteria);
|
||||
}
|
||||
$actors = $actor_qb->getQuery()->execute();
|
||||
|
||||
// TODO: Enforce scoping on the notes before returning
|
||||
return ['notes' => $notes ?? null, 'actors' => $actors ?? null];
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert $term to $note_expr and $actor_expr, search criteria. Handles searching for text
|
||||
* notes, for different types of actors and for the content of text notes
|
||||
*/
|
||||
public function onSearchCreateExpression(ExpressionBuilder $eb, string $term, ?string $language, &$note_expr, &$actor_expr): bool
|
||||
{
|
||||
if (str_contains($term, ':')) {
|
||||
$term = explode(':', $term);
|
||||
if (Formatting::startsWith($term[0], 'note-')) {
|
||||
switch ($term[0]) {
|
||||
case 'note-local':
|
||||
$note_expr = $eb->eq('note.is_local', filter_var($term[1], \FILTER_VALIDATE_BOOLEAN));
|
||||
break;
|
||||
case 'note-types':
|
||||
case 'notes-include':
|
||||
case 'note-filter':
|
||||
if (\is_null($note_expr)) {
|
||||
$note_expr = [];
|
||||
}
|
||||
if (array_intersect(explode(',', $term[1]), ['text', 'words']) !== []) {
|
||||
$note_expr[] = $eb->neq('note.content', null);
|
||||
} else {
|
||||
$note_expr[] = $eb->eq('note.content', null);
|
||||
}
|
||||
break;
|
||||
}
|
||||
} elseif (Formatting::startsWith($term, 'actor-')) {
|
||||
switch ($term[0]) {
|
||||
case 'actor-types':
|
||||
case 'actors-include':
|
||||
case 'actor-filter':
|
||||
case 'actor-local':
|
||||
if (\is_null($actor_expr)) {
|
||||
$actor_expr = [];
|
||||
}
|
||||
foreach (
|
||||
[
|
||||
Actor::PERSON => ['person', 'people'],
|
||||
Actor::GROUP => ['group', 'groups'],
|
||||
Actor::ORGANIZATION => ['org', 'orgs', 'organization', 'organizations', 'organisation', 'organisations'],
|
||||
Actor::BUSINESS => ['business', 'businesses'],
|
||||
Actor::BOT => ['bot', 'bots'],
|
||||
] as $type => $match) {
|
||||
if (array_intersect(explode(',', $term[1]), $match) !== []) {
|
||||
$actor_expr[] = $eb->eq('actor.type', $type);
|
||||
} else {
|
||||
$actor_expr[] = $eb->neq('actor.type', $type);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$note_expr = $eb->contains('note.content', $term);
|
||||
}
|
||||
return Event::next;
|
||||
}
|
||||
}
|
58
components/Feed/Util/FeedController.php
Normal file
58
components/Feed/Util/FeedController.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types = 1);
|
||||
|
||||
// {{{ License
|
||||
// This file is part of GNU social - https://www.gnu.org/software/social
|
||||
//
|
||||
// GNU social is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// GNU social is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with GNU social. If not, see <http://www.gnu.org/licenses/>.
|
||||
// }}}
|
||||
|
||||
/**
|
||||
* Base class for feed controllers
|
||||
*
|
||||
* @package GNUsocial
|
||||
* @category Controller
|
||||
*
|
||||
* @author Hugo Sales <hugo@hsal.es>
|
||||
* @copyright 2021 Free Software Foundation, Inc http://www.fsf.org
|
||||
* @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
|
||||
*/
|
||||
|
||||
namespace Component\Feed\Util;
|
||||
|
||||
use App\Core\Controller;
|
||||
use App\Core\Event;
|
||||
use App\Util\Common;
|
||||
|
||||
abstract class FeedController extends Controller
|
||||
{
|
||||
/**
|
||||
* Post process the result of a feed controller, to remove any
|
||||
* notes or actors the user specified, as well as format the raw
|
||||
* list of notes into a usable format
|
||||
*/
|
||||
public static function post_process(array $result): array
|
||||
{
|
||||
$actor = Common::actor();
|
||||
|
||||
if (\array_key_exists('notes', $result)) {
|
||||
$notes = $result['notes'];
|
||||
Event::handle('FilterNoteList', [$actor, &$notes, $result['request']]);
|
||||
Event::handle('FormatNoteList', [$notes, &$result['notes']]);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
34
components/Feed/templates/feed/feed.html.twig
Normal file
34
components/Feed/templates/feed/feed.html.twig
Normal file
@@ -0,0 +1,34 @@
|
||||
{% extends 'stdgrid.html.twig' %}
|
||||
{% import '/cards/note/view.html.twig' as noteView %}
|
||||
|
||||
{% block title %}{% if page_title is defined %}{{ page_title | trans }}{% endif %}{% endblock %}
|
||||
|
||||
{% block stylesheets %}
|
||||
{{ parent() }}
|
||||
<link rel="stylesheet" href="{{ asset('assets/default_theme/css/pages/feeds.css') }}" type="text/css">
|
||||
{% endblock stylesheets %}
|
||||
|
||||
{% block body %}
|
||||
{% for block in handle_event('BeforeFeed', app.request) %}
|
||||
{{ block | raw }}
|
||||
{% endfor %}
|
||||
{# Backwards compatibility with hAtom 0.1 #}
|
||||
<main class="feed" tabindex="0" role="feed">
|
||||
<div class="h-feed hfeed notes">
|
||||
{% if notes is defined and notes is not empty %}
|
||||
{% for conversation in notes %}
|
||||
{% block current_note %}
|
||||
{% if conversation is instanceof('array') %}
|
||||
{{ noteView.macro_note(conversation['note'], conversation['replies']) }}
|
||||
{% else %}
|
||||
{{ noteView.macro_note(conversation) }}
|
||||
{% endif %}
|
||||
<hr tabindex="0" title="{{ 'End of note and replies.' | trans }}">
|
||||
{% endblock current_note %}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<div id="empty-notes"><h1>{% trans %}No notes here.{% endtrans %}</h1></div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</main>
|
||||
{% endblock body %}
|
113
components/FreeNetwork/Controller/Feeds.php
Normal file
113
components/FreeNetwork/Controller/Feeds.php
Normal file
@@ -0,0 +1,113 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types = 1);
|
||||
|
||||
// {{{ License
|
||||
|
||||
// This file is part of GNU social - https://www.gnu.org/software/social
|
||||
//
|
||||
// GNU social is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// GNU social is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with GNU social. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
// }}}
|
||||
|
||||
/**
|
||||
* Handle network public feed
|
||||
*
|
||||
* @package GNUsocial
|
||||
* @category Controller
|
||||
*
|
||||
* @author Diogo Peralta Cordeiro <@diogo.site>
|
||||
* @copyright 2020-2021 Free Software Foundation, Inc http://www.fsf.org
|
||||
* @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
|
||||
*/
|
||||
|
||||
namespace Component\FreeNetwork\Controller;
|
||||
|
||||
use App\Core\DB\DB;
|
||||
use function App\Core\I18n\_m;
|
||||
use App\Util\Common;
|
||||
use Component\Feed\Feed;
|
||||
use Component\Feed\Util\FeedController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class Feeds extends FeedController
|
||||
{
|
||||
/**
|
||||
* The Meteorites feed represents every post coming from the
|
||||
* known fediverse to this instance's inbox. I.e., it's our
|
||||
* known network and excludes everything that is local only
|
||||
* or federated out.
|
||||
*/
|
||||
public function network(Request $request): array
|
||||
{
|
||||
$data = Feed::query(
|
||||
query: 'note-local:false',
|
||||
page: $this->int('p'),
|
||||
language: Common::actor()?->getTopLanguage()?->getLocale(),
|
||||
);
|
||||
return [
|
||||
'_template' => 'feed/feed.html.twig',
|
||||
'page_title' => _m('Meteorites'),
|
||||
'should_format' => true,
|
||||
'notes' => $data['notes'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* The Planetary System feed represents every planet-centric post, i.e.,
|
||||
* everything that is local or comes from outside with relation to local actors
|
||||
* or posts.
|
||||
*/
|
||||
public function clique(Request $request): array
|
||||
{
|
||||
$notes = DB::dql(
|
||||
<<<'EOF'
|
||||
SELECT n FROM \App\Entity\Note AS n
|
||||
WHERE n.is_local = true OR n.id IN (
|
||||
SELECT act.object_id FROM \App\Entity\Activity AS act
|
||||
WHERE act.object_type = 'note' AND act.id IN
|
||||
(SELECT att.activity_id FROM \Component\Notification\Entity\Notification AS att WHERE att.target_id IN
|
||||
(SELECT a.id FROM \App\Entity\Actor a WHERE a.is_local = true))
|
||||
)
|
||||
ORDER BY n.created DESC, n.id DESC
|
||||
EOF,
|
||||
);
|
||||
return [
|
||||
'_template' => 'feed/feed.html.twig',
|
||||
'page_title' => _m('Planetary System'),
|
||||
'should_format' => true,
|
||||
'notes' => $notes,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* The Galaxy feed represents everything that is federated out or federated in.
|
||||
* Given that any local post can be federated out and it's hard to specifically exclude these,
|
||||
* we simply return everything here, local and remote posts. So, a galaxy.
|
||||
*/
|
||||
public function federated(Request $request): array
|
||||
{
|
||||
$data = Feed::query(
|
||||
query: '',
|
||||
page: $this->int('p'),
|
||||
language: Common::actor()?->getTopLanguage()?->getLocale(),
|
||||
);
|
||||
return [
|
||||
'_template' => 'feed/feed.html.twig',
|
||||
'page_title' => _m('Galaxy'),
|
||||
'should_format' => true,
|
||||
'notes' => $data['notes'],
|
||||
];
|
||||
}
|
||||
}
|
@@ -25,7 +25,6 @@ namespace Component\LeftPanel\Controller;
|
||||
|
||||
use App\Core\Cache;
|
||||
use App\Core\Controller;
|
||||
use App\Core\Controller\FeedController;
|
||||
use App\Core\DB\DB;
|
||||
use App\Core\Form;
|
||||
use function App\Core\I18n\_m;
|
||||
@@ -34,6 +33,7 @@ use App\Entity\Feed;
|
||||
use App\Util\Common;
|
||||
use App\Util\Exception\ClientException;
|
||||
use App\Util\Exception\RedirectException;
|
||||
use Component\Feed\Util\FeedController;
|
||||
use Functional as F;
|
||||
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
|
@@ -23,9 +23,6 @@ declare(strict_types = 1);
|
||||
|
||||
namespace Component\Search\Controller;
|
||||
|
||||
use App\Core\Controller\FeedController;
|
||||
use App\Core\DB\DB;
|
||||
use App\Core\Event;
|
||||
use App\Core\Form;
|
||||
use function App\Core\I18n\_m;
|
||||
use App\Util\Common;
|
||||
@@ -33,8 +30,9 @@ use App\Util\Exception\BugFoundException;
|
||||
use App\Util\Exception\RedirectException;
|
||||
use App\Util\Form\FormFields;
|
||||
use App\Util\Formatting;
|
||||
use Component\Feed\Feed;
|
||||
use Component\Feed\Util\FeedController;
|
||||
use Component\Search as Comp;
|
||||
use Component\Search\Util\Parser;
|
||||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
@@ -50,26 +48,10 @@ class Search extends FeedController
|
||||
$actor = Common::actor();
|
||||
$language = !\is_null($actor) ? $actor->getTopLanguage()->getLocale() : null;
|
||||
$q = $this->string('q');
|
||||
if (!empty($q) && !empty($q = trim($q))) {
|
||||
[$note_criteria, $actor_criteria] = Parser::parse($q, $language);
|
||||
|
||||
$note_qb = DB::createQueryBuilder();
|
||||
$actor_qb = DB::createQueryBuilder();
|
||||
$note_qb->select('note')->from('App\Entity\Note', 'note')->orderBy('note.created', 'DESC');
|
||||
$actor_qb->select('actor')->from('App\Entity\Actor', 'actor')->orderBy('actor.created', 'DESC');
|
||||
Event::handle('SearchQueryAddJoins', [&$note_qb, &$actor_qb]);
|
||||
|
||||
$notes = $actors = [];
|
||||
if (!\is_null($note_criteria)) {
|
||||
$note_qb->addCriteria($note_criteria);
|
||||
$notes = $note_qb->getQuery()->execute();
|
||||
}
|
||||
|
||||
if (!\is_null($actor_criteria)) {
|
||||
$actor_qb->addCriteria($actor_criteria);
|
||||
$actors = $actor_qb->getQuery()->execute();
|
||||
}
|
||||
}
|
||||
$data = Feed::query(query: $q, page: $this->int('p'), language: $language);
|
||||
$notes = $data['notes'];
|
||||
$actors = $data['actors'];
|
||||
|
||||
$search_builder_form = Form::create([
|
||||
['include_actors', CheckboxType::class, ['required' => false, 'data' => false, 'label' => _m('Include people/actors')]],
|
||||
|
@@ -27,11 +27,8 @@ use App\Core\Event;
|
||||
use App\Core\Form;
|
||||
use function App\Core\I18n\_m;
|
||||
use App\Core\Modules\Component;
|
||||
use App\Entity\Actor;
|
||||
use App\Util\Common;
|
||||
use App\Util\Exception\RedirectException;
|
||||
use App\Util\Formatting;
|
||||
use Doctrine\Common\Collections\ExpressionBuilder;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormView;
|
||||
@@ -140,43 +137,4 @@ class Search extends Component
|
||||
$styles[] = 'components/Search/assets/css/view.css';
|
||||
return Event::next;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert $term to $note_expr and $actor_expr, search criteria. Handles searching for text
|
||||
* notes, for different types of actors and for the content of text notes
|
||||
*/
|
||||
public function onSearchCreateExpression(ExpressionBuilder $eb, string $term, ?string $language, &$note_expr, &$actor_expr): bool
|
||||
{
|
||||
$include_term = str_contains($term, ':') ? explode(':', $term)[1] : $term;
|
||||
if (Formatting::startsWith($term, ['note-types:', 'notes-incude:', 'note-filter:'])) {
|
||||
if (\is_null($note_expr)) {
|
||||
$note_expr = [];
|
||||
}
|
||||
if (array_intersect(explode(',', $include_term), ['text', 'words']) !== []) {
|
||||
$note_expr[] = $eb->neq('note.rendered', null);
|
||||
} else {
|
||||
$note_expr[] = $eb->eq('note.rendered', null);
|
||||
}
|
||||
} elseif (Formatting::startsWith($term, ['actor-types:', 'actors-incude:', 'actor-filter:'])) {
|
||||
if (\is_null($actor_expr)) {
|
||||
$actor_expr = [];
|
||||
}
|
||||
foreach ([
|
||||
Actor::PERSON => ['person', 'people'],
|
||||
Actor::GROUP => ['group', 'groups'],
|
||||
Actor::ORGANIZATION => ['org', 'orgs', 'organization', 'organizations', 'organisation', 'organisations'],
|
||||
Actor::BUSINESS => ['business', 'businesses'],
|
||||
Actor::BOT => ['bot', 'bots'],
|
||||
] as $type => $match) {
|
||||
if (array_intersect(explode(',', $include_term), $match) !== []) {
|
||||
$actor_expr[] = $eb->eq('actor.type', $type);
|
||||
} else {
|
||||
$actor_expr[] = $eb->neq('actor.type', $type);
|
||||
}
|
||||
}
|
||||
} elseif (!str_contains($term, ':')) {
|
||||
$note_expr = $eb->contains('note.rendered', $term);
|
||||
}
|
||||
return Event::next;
|
||||
}
|
||||
}
|
||||
|
@@ -48,7 +48,7 @@ abstract class Parser
|
||||
* Currently doesn't support nesting with parenthesis and
|
||||
* recognises either spaces (currently `or`, should be fuzzy match), `OR` or `|` (`or`) and `AND` or `&` (`and`)
|
||||
*
|
||||
* TODO Better fuzzy match, implement exact match with quotes and nesting with parens
|
||||
* TODO: Better fuzzy match, implement exact match with quotes and nesting with parens
|
||||
*
|
||||
* @return Criteria[]
|
||||
*/
|
||||
@@ -58,9 +58,9 @@ abstract class Parser
|
||||
$input = trim(preg_replace(['/\s+/', '/\s+AND\s+/', '/\s+OR\s+/'], [' ', '&', '|'], $input), ' |&');
|
||||
}
|
||||
|
||||
$left = $right = 0;
|
||||
$left = 0;
|
||||
$right = 0;
|
||||
$lenght = mb_strlen($input);
|
||||
$stack = [];
|
||||
$eb = Criteria::expr();
|
||||
$note_criteria_arr = [];
|
||||
$actor_criteria_arr = [];
|
||||
@@ -74,9 +74,10 @@ abstract class Parser
|
||||
|
||||
foreach (['&', '|', ' '] as $delimiter) {
|
||||
if ($input[$index] === $delimiter || $end = ($index === $lenght - 1)) {
|
||||
$term = mb_substr($input, $left, $end ? null : $right - $left);
|
||||
$note_res = $actor_res = null;
|
||||
$ret = Event::handle('SearchCreateExpression', [$eb, $term, $language, &$note_res, &$actor_res]);
|
||||
$term = mb_substr($input, $left, $end ? null : $right - $left);
|
||||
$note_res = null;
|
||||
$actor_res = null;
|
||||
Event::handle('SearchCreateExpression', [$eb, $term, $language, &$note_res, &$actor_res]);
|
||||
if (\is_null($note_res) && \is_null($actor_res)) {
|
||||
throw new ServerException("No one claimed responsibility for a match term: {$term}");
|
||||
}
|
||||
@@ -88,7 +89,7 @@ abstract class Parser
|
||||
}
|
||||
if (!\is_null($actor_res) && !empty($note_res)) {
|
||||
if (\is_array($actor_res)) {
|
||||
$actor_res = $ex->orX(...$actor_res);
|
||||
$actor_res = $eb->orX(...$actor_res);
|
||||
}
|
||||
$actor_parts[] = $actor_res;
|
||||
}
|
||||
@@ -97,7 +98,6 @@ abstract class Parser
|
||||
|
||||
if (!\is_null($last_op) && $last_op !== $delimiter) {
|
||||
self::connectParts($note_parts, $note_criteria_arr, $last_op, $eb, force: false);
|
||||
self::connectParts($actor_parts, $actor_criteria_arr, $last_op, $eb, force: false);
|
||||
} else {
|
||||
$last_op = $delimiter;
|
||||
}
|
||||
@@ -110,7 +110,8 @@ abstract class Parser
|
||||
}
|
||||
}
|
||||
|
||||
$note_criteria = $actor_criteria = null;
|
||||
$note_criteria = null;
|
||||
$actor_criteria = null;
|
||||
if (!empty($note_parts)) {
|
||||
self::connectParts($note_parts, $note_criteria_arr, $last_op, $eb, force: true);
|
||||
$note_criteria = new Criteria($eb->orX(...$note_criteria_arr));
|
||||
|
@@ -1,4 +1,4 @@
|
||||
{% extends 'feeds/feed.html.twig' %}
|
||||
{% extends 'feed/feed.html.twig' %}
|
||||
|
||||
|
||||
{% block body %}
|
||||
|
Reference in New Issue
Block a user