]> git.mxchange.org Git - friendica.git/commitdiff
Remove unused uid parameter in Item::newURI
authorHypolite Petovan <hypolite@mrpetovan.com>
Sat, 9 Jul 2022 11:32:32 +0000 (07:32 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sat, 9 Jul 2022 11:39:51 +0000 (07:39 -0400)
mod/item.php
mod/photos.php
mod/tagger.php
src/Model/Event.php
src/Model/Item.php
src/Model/Mail.php
src/Module/Api/Mastodon/Statuses.php
src/Module/Contact/Poke.php
src/Protocol/ActivityPub/Transmitter.php
src/Protocol/Feed.php

index 2bfdf07a3b36a852ca1314af5a3d2c0c72e87ef4..a840ea9ad9922480008752851f8454f7c668af10 100644 (file)
@@ -525,7 +525,7 @@ function item_post(App $a) {
                $origin = $_REQUEST['origin'];
        }
 
-       $uri = Item::newURI($api_source ? $profile_uid : $uid, $guid);
+       $uri = Item::newURI($guid);
 
        // Fallback so that we alway have a parent uri
        if (!$thr_parent_uri || !$toplevel_item_id) {
index 745cea30ce7ba17e62441f67d33b7905e8328c91..bd9762882ea96ea831e4ae4e4ce6756938a680b7 100644 (file)
@@ -360,7 +360,7 @@ function photos_post(App $a)
                if (DBA::isResult($photos) && !$item_id) {
                        // Create item container
                        $title = '';
-                       $uri = Item::newURI($page_owner_uid);
+                       $uri = Item::newURI();
 
                        $arr = [];
                        $arr['guid']          = System::createUUID();
@@ -524,7 +524,7 @@ function photos_post(App $a)
 
                        if (count($taginfo)) {
                                foreach ($taginfo as $tagged) {
-                                       $uri = Item::newURI($page_owner_uid);
+                                       $uri = Item::newURI();
 
                                        $arr = [];
                                        $arr['guid']          = System::createUUID();
@@ -728,7 +728,7 @@ function photos_post(App $a)
                $smallest = 2;
        }
 
-       $uri = Item::newURI($page_owner_uid);
+       $uri = Item::newURI();
 
        // Create item container
        $lat = $lon = null;
index 1acce4b0b60e2cd56c150c62207bcdb0a6a028a2..e674efba698a567a66398eb8dc8c2ccccd6aaee4 100644 (file)
@@ -73,7 +73,7 @@ function tagger_content(App $a) {
                return;
        }
 
-       $uri = Item::newURI($owner_uid);
+       $uri = Item::newURI();
        $xterm = XML::escape($term);
        $post_type = (($item['resource-id']) ? DI::l10n()->t('photo') : DI::l10n()->t('status'));
        $targettype = (($item['resource-id']) ? Activity\ObjectType::IMAGE : Activity\ObjectType::NOTE );
index f63ec3d559882ef75f91e5c65402426f9478029e..74bf3bd9c0cd45b1ac18d3fed1160359a7606f6f 100644 (file)
@@ -248,7 +248,7 @@ class Event
                $event['uid']       = intval($arr['uid']       ?? 0);
                $event['cid']       = intval($arr['cid']       ?? 0);
                $event['guid']      =       ($arr['guid']      ?? '') ?: System::createUUID();
-               $event['uri']       =       ($arr['uri']       ?? '') ?: Item::newURI($event['uid'], $event['guid']);
+               $event['uri']       =       ($arr['uri']       ?? '') ?: Item::newURI($event['guid']);
                $event['uri-id']    = ItemURI::insert(['uri' => $event['uri'], 'guid' => $event['guid']]);
                $event['type']      =       ($arr['type']      ?? '') ?: 'event';
                $event['summary']   =        $arr['summary']   ?? '';
index bf3ca49dbcca9f1aebd36a598488aca6ae546ecd..01ea942c869fec0c5e01ca45d7f17deb76d9d1af 100644 (file)
@@ -780,7 +780,7 @@ class Item
                $uid = intval($item['uid']);
 
                $item['guid'] = self::guid($item, $notify);
-               $item['uri'] = substr(trim($item['uri'] ?? '') ?: self::newURI($item['uid'], $item['guid']), 0, 255);
+               $item['uri'] = substr(trim($item['uri'] ?? '') ?: self::newURI($item['guid']), 0, 255);
 
                // Store URI data
                $item['uri-id'] = ItemURI::insert(['uri' => $item['uri'], 'guid' => $item['guid']]);
@@ -1853,13 +1853,12 @@ class Item
        /**
         * generate an unique URI
         *
-        * @param integer $uid  User id
-        * @param string  $guid An existing GUID (Otherwise it will be generated)
+        * @param string $guid An existing GUID (Otherwise it will be generated)
         *
         * @return string
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function newURI(int $uid, string $guid = ''): string
+       public static function newURI(string $guid = ''): string
        {
                if ($guid == '') {
                        $guid = System::createUUID();
@@ -2150,7 +2149,7 @@ class Item
                                $old_uri_id = $datarray["uri-id"] ?? 0;
                                $datarray["guid"] = System::createUUID();
                                unset($datarray["plink"]);
-                               $datarray["uri"] = self::newURI($contact['uid'], $datarray["guid"]);
+                               $datarray["uri"] = self::newURI($datarray["guid"]);
                                $datarray["uri-id"] = ItemURI::getIdByURI($datarray["uri"]);
                                $datarray["extid"] = Protocol::DFRN;
                                $urlpart = parse_url($datarray2['author-link']);
@@ -2591,7 +2590,7 @@ class Item
 
                $new_item = [
                        'guid'          => System::createUUID(),
-                       'uri'           => self::newURI($item['uid']),
+                       'uri'           => self::newURI(),
                        'uid'           => $item['uid'],
                        'contact-id'    => $owner['id'],
                        'wall'          => $item['wall'],
index e42cb4ca43a14f425482fce306d356fc7711ced3..afe3a3227ae620f1a80001cb8698f3191c98356a 100644 (file)
@@ -154,7 +154,7 @@ class Mail
                Photo::setPermissionFromBody($body, local_user(), $me['id'],  '<' . $contact['id'] . '>', '', '', '');
 
                $guid = System::createUUID();
-               $uri = Item::newURI(local_user(), $guid);
+               $uri = Item::newURI($guid);
 
                $convid = 0;
                $reply = false;
@@ -266,7 +266,7 @@ class Mail
                }
 
                $guid = System::createUUID();
-               $uri = Item::newURI(local_user(), $guid);
+               $uri = Item::newURI($guid);
 
                $me = Contact::getByURL($replyto);
                if (!$me['name']) {
index 5392a98777cc06865d9121863a0710acb045f7ef..4a8c98697d42d8bb27b9c32c77dce66443d6b463 100644 (file)
@@ -203,7 +203,7 @@ class Statuses extends BaseApi
 
                if (!empty($request['scheduled_at'])) {
                        $item['guid'] = Item::guid($item, true);
-                       $item['uri'] = Item::newURI($item['uid'], $item['guid']);
+                       $item['uri'] = Item::newURI($item['guid']);
                        $id = Post\Delayed::add($item['uri'], $item, PRIORITY_HIGH, Post\Delayed::PREPARED, $request['scheduled_at']);
                        if (empty($id)) {
                                DI::mstdnError()->InternalError();
index 0bbc40a9806aac97ef6f2befffbec21135c4b772..5836c513f9d8d1922a08e8bd27b93180da176502 100644 (file)
@@ -82,7 +82,7 @@ class Poke extends BaseModule
 
                $actor = Contact::getById($a->getContactId());
 
-               $uri = Model\Item::newURI($uid);
+               $uri = Model\Item::newURI();
 
                $arr = [];
 
index 4c9bd3e21442e0217a9790952e01cbff71c3291d..a9c163964e0c5ca74983bbf2f99b009aebb5aba4 100644 (file)
@@ -1271,7 +1271,7 @@ class Transmitter
                }
 
                if ($type == 'Delete') {
-                       $data['id'] = Item::newURI($item['uid'], $item['guid']) . '/' . $type;;
+                       $data['id'] = Item::newURI($item['guid']) . '/' . $type;;
                } elseif (($item['gravity'] == GRAVITY_ACTIVITY) && ($type != 'Undo')) {
                        $data['id'] = $item['uri'];
                } else {
index 65b0696effb5a3fd9b20dd8dc817c64a9507f8c8..6601a2e8c32d3febb27204818ea244e8b4075c1b 100644 (file)
@@ -618,7 +618,7 @@ class Feed
                        // Additionally we have to avoid conflicts with identical URI between imported feeds and these items.
                        if ($notify) {
                                $item['guid'] = Item::guidFromUri($orig_plink, DI::baseUrl()->getHostname());
-                               $item['uri'] = Item::newURI($item['uid'], $item['guid']);
+                               $item['uri'] = Item::newURI($item['guid']);
                                unset($item['thr-parent']);
                                unset($item['parent-uri']);