]> git.mxchange.org Git - friendica.git/commitdiff
Fix errors introduced by PR #11997
authorMichael <heluecht@pirati.ca>
Tue, 18 Oct 2022 18:32:20 +0000 (18:32 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 18 Oct 2022 18:32:20 +0000 (18:32 +0000)
src/Content/Item.php
src/Module/Profile/Status.php

index 80edecc8210e642fd2c20e6d5596f6dc71630492..b363ad982bfefcf498a7ec10e3d9d73dc41b804d 100644 (file)
@@ -580,11 +580,11 @@ class Item
        public function createSharedPostByUrl(string $url, int $uid = 0, bool $add_media = false): string
        {
                if (!empty($uid)) {
-                       $id = ModelItem::searchByLink($url, $uid);
+                       $id = ItemModel::searchByLink($url, $uid);
                }
 
                if (empty($id)) {
-                       $id = ModelItem::fetchByLink($url);
+                       $id = ItemModel::fetchByLink($url);
                }
 
                if (!$id) {
@@ -614,7 +614,7 @@ class Item
        public function createSharedPostByUriId(int $UriId, int $uid = 0, bool $add_media = false): string
        {
                $fields = ['uri-id', 'uri', 'body', 'title', 'author-name', 'author-link', 'author-avatar', 'guid', 'created', 'plink', 'network'];
-               $shared_item = Post::selectFirst($fields, ['uri-id' => $UriId, 'uid' => [$uid, 0], 'private' => [ModelItem::PUBLIC, ModelItem::UNLISTED]]);
+               $shared_item = Post::selectFirst($fields, ['uri-id' => $UriId, 'uid' => [$uid, 0], 'private' => [ItemModel::PUBLIC, ItemModel::UNLISTED]]);
                if (!DBA::isResult($shared_item)) {
                        Logger::notice('Post does not exist.', ['uri-id' => $UriId, 'uid' => $uid]);
                        return '';
@@ -634,11 +634,11 @@ class Item
        public function createSharedPostByGuid(string $guid, int $uid = 0, string $host = '', bool $add_media = false): string
        {
                $fields = ['uri-id', 'uri', 'body', 'title', 'author-name', 'author-link', 'author-avatar', 'guid', 'created', 'plink', 'network'];
-               $shared_item = Post::selectFirst($fields, ['guid' => $guid, 'uid' => [$uid, 0], 'private' => [ModelItem::PUBLIC, ModelItem::UNLISTED]]);
+               $shared_item = Post::selectFirst($fields, ['guid' => $guid, 'uid' => [$uid, 0], 'private' => [ItemModel::PUBLIC, ItemModel::UNLISTED]]);
 
                if (!DBA::isResult($shared_item) && !empty($host) && Diaspora::storeByGuid($guid, $host, true)) {
                        Logger::debug('Fetched post', ['guid' => $guid, 'host' => $host, 'uid' => $uid]);
-                       $shared_item = Post::selectFirst($fields, ['guid' => $guid, 'uid' => [$uid, 0], 'private' => [ModelItem::PUBLIC, ModelItem::UNLISTED]]);
+                       $shared_item = Post::selectFirst($fields, ['guid' => $guid, 'uid' => [$uid, 0], 'private' => [ItemModel::PUBLIC, ItemModel::UNLISTED]]);
                } elseif (DBA::isResult($shared_item)) {
                        Logger::debug('Found existing post', ['guid' => $guid, 'host' => $host, 'uid' => $uid]);
                }
index 7cdd907c8a1fe666efb6ea23d7f699f811c4dc5a..1a313cbfaecde41308109ecb0e1f8664df5756b8 100644 (file)
@@ -176,7 +176,7 @@ class Status extends BaseProfile
                $condition = DBA::mergeConditions($condition, ["((`gravity` = ? AND `wall`) OR
                        (`gravity` = ? AND `vid` = ? AND `origin`
                        AND `thr-parent-id` IN (SELECT `uri-id` FROM `post` WHERE `gravity` = ? AND `network` = ?)))",
-                       GRAVITY_PARENT, Item::GRAVITY_ACTIVITY, Verb::getID(Activity::ANNOUNCE), Item::GRAVITY_PARENT, Protocol::ACTIVITYPUB]);
+                       Item::GRAVITY_PARENT, Item::GRAVITY_ACTIVITY, Verb::getID(Activity::ANNOUNCE), Item::GRAVITY_PARENT, Protocol::ACTIVITYPUB]);
 
                $condition = DBA::mergeConditions($condition, ['uid' => $profile['uid'], 'network' => Protocol::FEDERATED,
                        'visible' => true, 'deleted' => false]);