]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Search/Acl.php
Remove the activity
[friendica.git] / src / Module / Search / Acl.php
index 9c854839e53867eacf462d7d323d538aaae86ca6..9f072b91c938df938c70ceb6047b1cda5fcea908 100644 (file)
@@ -51,7 +51,7 @@ class Acl extends BaseModule
 
        protected function rawContent(array $request = [])
        {
-               if (!local_user()) {
+               if (!DI::userSession()->getLocalUserId()) {
                        throw new HTTPException\UnauthorizedException(DI::l10n()->t('You must be logged in to use this module.'));
                }
 
@@ -113,8 +113,8 @@ class Acl extends BaseModule
                Logger::info('ACL {action} - {subaction} - start', ['module' => 'acl', 'action' => 'content', 'subaction' => 'search', 'search' => $search, 'type' => $type, 'conversation' => $conv_id]);
 
                $sql_extra = '';
-               $condition       = ["`uid` = ? AND NOT `deleted` AND NOT `pending` AND NOT `archive`", local_user()];
-               $condition_group = ["`uid` = ? AND NOT `deleted`", local_user()];
+               $condition       = ["`uid` = ? AND NOT `deleted` AND NOT `pending` AND NOT `archive`", DI::userSession()->getLocalUserId()];
+               $condition_group = ["`uid` = ? AND NOT `deleted`", DI::userSession()->getLocalUserId()];
 
                if ($search != '') {
                        $sql_extra = "AND `name` LIKE '%%" . DBA::escape($search) . "%%'";
@@ -135,13 +135,13 @@ class Acl extends BaseModule
                switch ($type) {
                        case self::TYPE_MENTION_CONTACT_GROUP:
                                $condition = DBA::mergeConditions($condition,
-                                       ["NOT `self` AND NOT `blocked` AND `notify` != ? AND NOT `network` IN (?, ?)", '', Protocol::OSTATUS, Protocol::STATUSNET
+                                       ["NOT `self` AND NOT `blocked` AND `notify` != ? AND `network` != ?", '', Protocol::OSTATUS
                                ]);
                                break;
 
                        case self::TYPE_MENTION_CONTACT:
                                $condition = DBA::mergeConditions($condition,
-                                       ["NOT `self` AND NOT `blocked` AND `notify` != ? AND `network` != ?", '', Protocol::STATUSNET
+                                       ["NOT `self` AND NOT `blocked` AND `notify` != ?", ''
                                ]);
                                break;
 
@@ -176,7 +176,7 @@ class Acl extends BaseModule
                                GROUP BY `group`.`name`, `group`.`id`
                                ORDER BY `group`.`name`
                                LIMIT ?, ?",
-                               local_user(),
+                               DI::userSession()->getLocalUserId(),
                                $start,
                                $count
                        ));
@@ -251,7 +251,7 @@ class Acl extends BaseModule
 
                        $condition = ["`parent` = ?", $conv_id];
                        $params = ['order' => ['author-name' => true]];
-                       $authors = Post::selectForUser(local_user(), ['author-link'], $condition, $params);
+                       $authors = Post::selectForUser(DI::userSession()->getLocalUserId(), ['author-link'], $condition, $params);
                        $item_authors = [];
                        while ($author = Post::fetch($authors)) {
                                $item_authors[$author['author-link']] = $author['author-link'];