From a7dd0173a735291bee4d57bb3d9adcf064feb34d Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Mon, 27 Jan 2020 22:01:12 -0500 Subject: [PATCH] Remove obsolete profile_id parameter in Model\Profile::load --- mod/common.php | 2 +- mod/crepair.php | 2 +- mod/display.php | 2 +- mod/follow.php | 2 +- mod/unfollow.php | 2 +- src/Model/Profile.php | 3 +-- src/Module/AllFriends.php | 2 +- src/Module/Contact.php | 4 ++-- src/Module/HoverCard.php | 4 +--- src/Module/NoScrape.php | 4 +--- 10 files changed, 11 insertions(+), 16 deletions(-) diff --git a/mod/common.php b/mod/common.php index d2e7baecae..7e1dcc1859 100644 --- a/mod/common.php +++ b/mod/common.php @@ -41,7 +41,7 @@ function common_content(App $a) if (DBA::isResult($contact)) { DI::page()['aside'] = ""; - Model\Profile::load($a, "", 0, Model\Contact::getDetailsByURL($contact["url"])); + Model\Profile::load($a, "", Model\Contact::getDetailsByURL($contact["url"])); } } else { $contact = DBA::selectFirst('contact', ['name', 'url', 'photo', 'uid', 'id'], ['self' => true, 'uid' => $uid]); diff --git a/mod/crepair.php b/mod/crepair.php index aec1b60471..a3caf95e66 100644 --- a/mod/crepair.php +++ b/mod/crepair.php @@ -108,7 +108,7 @@ function crepair_content(App $a) if (DBA::isResult($contact)) { $a->data['contact'] = $contact; - Model\Profile::load($a, "", 0, Model\Contact::getDetailsByURL($contact["url"])); + Model\Profile::load($a, "", Model\Contact::getDetailsByURL($contact["url"])); } $warning = DI::l10n()->t('WARNING: This is highly advanced and if you enter incorrect information your communications with this contact may stop working.'); diff --git a/mod/display.php b/mod/display.php index 582bcde28e..6784a20c49 100644 --- a/mod/display.php +++ b/mod/display.php @@ -114,7 +114,7 @@ function display_init(App $a) } } - Profile::load($a, $nick, 0, $profiledata); + Profile::load($a, $nick, $profiledata); } function display_fetchauthor($a, $item) diff --git a/mod/follow.php b/mod/follow.php index 5ab3d35264..cdd7b4904e 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -192,7 +192,7 @@ function follow_content(App $a) $profiledata = Contact::getDetailsByURL($ret['url']); if ($profiledata) { - Profile::load($a, '', 0, $profiledata, false); + Profile::load($a, '', $profiledata, false); } if ($gcontact_id <> 0) { diff --git a/mod/unfollow.php b/mod/unfollow.php index f64c2a4c96..0d13c73afc 100644 --- a/mod/unfollow.php +++ b/mod/unfollow.php @@ -141,7 +141,7 @@ function unfollow_content(App $a) ]); DI::page()['aside'] = ''; - Profile::load($a, '', 0, Contact::getDetailsByURL($contact['url'])); + Profile::load($a, '', Contact::getDetailsByURL($contact['url'])); $o .= Renderer::replaceMacros(Renderer::getMarkupTemplate('section_title.tpl'), ['$title' => DI::l10n()->t('Status Messages and Posts')]); diff --git a/src/Model/Profile.php b/src/Model/Profile.php index 18b09225e7..a8f3f6ac6f 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -121,13 +121,12 @@ class Profile * * @param App $a * @param string $nickname string - * @param int $profile_id int * @param array $profiledata array * @param boolean $show_connect Show connect link * @throws \Friendica\Network\HTTPException\InternalServerErrorException * @throws \ImagickException */ - public static function load(App $a, $nickname, $profile_id = 0, array $profiledata = [], $show_connect = true) + public static function load(App $a, $nickname, array $profiledata = [], $show_connect = true) { $user = DBA::selectFirst('user', ['uid'], ['nickname' => $nickname, 'account_removed' => false]); diff --git a/src/Module/AllFriends.php b/src/Module/AllFriends.php index 662dc17e4c..ffb57ccf6f 100644 --- a/src/Module/AllFriends.php +++ b/src/Module/AllFriends.php @@ -44,7 +44,7 @@ class AllFriends extends BaseModule } DI::page()['aside'] = ""; - Model\Profile::load($app, "", 0, Model\Contact::getDetailsByURL($contact["url"])); + Model\Profile::load($app, "", Model\Contact::getDetailsByURL($contact["url"])); $total = Model\GContact::countAllFriends(local_user(), $cid); diff --git a/src/Module/Contact.php b/src/Module/Contact.php index d087634e48..7ce47b9cd7 100644 --- a/src/Module/Contact.php +++ b/src/Module/Contact.php @@ -957,7 +957,7 @@ class Contact extends BaseModule $profiledata = Model\Contact::getDetailsByURL($contact['url']); - Model\Profile::load($a, '', 0, $profiledata, true); + Model\Profile::load($a, '', $profiledata, true); $o .= Model\Contact::getPostsFromUrl($contact['url'], true, $update); } @@ -979,7 +979,7 @@ class Contact extends BaseModule $profiledata['remoteconnect'] = DI::baseUrl() . '/follow?url=' . urlencode($profiledata['url']); } - Model\Profile::load($a, '', 0, $profiledata, true); + Model\Profile::load($a, '', $profiledata, true); $o .= Model\Contact::getPostsFromUrl($contact['url']); } diff --git a/src/Module/HoverCard.php b/src/Module/HoverCard.php index 8f4186b03b..c2b1d6b46d 100644 --- a/src/Module/HoverCard.php +++ b/src/Module/HoverCard.php @@ -21,16 +21,14 @@ class HoverCard extends BaseModule if ((local_user()) && ($parameters['action'] ?? '') === 'view') { // A logged in user views a profile of a user $nickname = $a->user['nickname']; - $profile = $parameters['profile']; } elseif (empty($parameters['action'])) { // Show the profile hovercard $nickname = $parameters['profile']; - $profile = 0; } else { throw new NotFoundException(DI::l10n()->t('No profile')); } - Profile::load($a, $nickname, $profile); + Profile::load($a, $nickname); $page = DI::page(); diff --git a/src/Module/NoScrape.php b/src/Module/NoScrape.php index 99b55f273d..c8b701e403 100644 --- a/src/Module/NoScrape.php +++ b/src/Module/NoScrape.php @@ -25,17 +25,15 @@ class NoScrape extends BaseModule if (isset($parameters['nick'])) { // Get infos about a specific nick (public) $which = $parameters['nick']; - $profile = 0; } elseif (local_user() && isset($parameters['profile']) && DI::args()->get(2) == 'view') { // view infos about a known profile (needs a login) $which = $a->user['nickname']; - $profile = $parameters['profile']; } else { System::jsonError(403, 'Authentication required'); exit(); } - Profile::load($a, $which, $profile); + Profile::load($a, $nickname); $json_info = [ 'addr' => $a->profile['addr'],