mirror of
https://github.com/friendica/friendica
synced 2025-04-29 07:44:23 +02:00
Channels can now be based on the "network" feed as well
This commit is contained in:
parent
5479618f1c
commit
ffbab95c20
8 changed files with 200 additions and 157 deletions
|
@ -27,6 +27,7 @@ use Friendica\Content\Conversation\Entity;
|
|||
use Friendica\Content\Conversation\Factory;
|
||||
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
|
||||
use Friendica\Database\Database;
|
||||
use Friendica\Model\Post\Engagement;
|
||||
use Friendica\Model\User;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
|
@ -155,10 +156,10 @@ class UserDefinedChannel extends \Friendica\BaseRepository
|
|||
|
||||
$store = false;
|
||||
$this->db->insert('check-full-text-search', ['pid' => getmypid(), 'searchtext' => $searchtext], Database::INSERT_UPDATE);
|
||||
$channels = $this->db->select(self::$table_name, ['full-text-search', 'uid', 'label'], ["`full-text-search` != ?", '']);
|
||||
$channels = $this->db->select(self::$table_name, ['full-text-search', 'uid', 'label'], ["`full-text-search` != ? AND `circle` = ?", '', 0]);
|
||||
while ($channel = $this->db->fetch($channels)) {
|
||||
$channelsearchtext = $channel['full-text-search'];
|
||||
foreach (['from', 'to', 'group', 'tag', 'network', 'platform', 'visibility'] as $keyword) {
|
||||
foreach (Engagement::KEYWORDS as $keyword) {
|
||||
$channelsearchtext = preg_replace('~(' . $keyword . ':.[\w@\.-]+)~', '"$1"', $channelsearchtext);
|
||||
}
|
||||
if ($this->db->exists('check-full-text-search', ["`pid` = ? AND MATCH (`searchtext`) AGAINST (? IN BOOLEAN MODE)", getmypid(), $channelsearchtext])) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue