Remove obsolete profile_id parameter in Model\Profile::load

This commit is contained in:
Hypolite Petovan 2020-01-27 22:01:12 -05:00
parent 0b8fd92e1e
commit a7dd0173a7
10 changed files with 11 additions and 16 deletions

View File

@ -41,7 +41,7 @@ function common_content(App $a)
if (DBA::isResult($contact)) { if (DBA::isResult($contact)) {
DI::page()['aside'] = ""; DI::page()['aside'] = "";
Model\Profile::load($a, "", 0, Model\Contact::getDetailsByURL($contact["url"])); Model\Profile::load($a, "", Model\Contact::getDetailsByURL($contact["url"]));
} }
} else { } else {
$contact = DBA::selectFirst('contact', ['name', 'url', 'photo', 'uid', 'id'], ['self' => true, 'uid' => $uid]); $contact = DBA::selectFirst('contact', ['name', 'url', 'photo', 'uid', 'id'], ['self' => true, 'uid' => $uid]);

View File

@ -108,7 +108,7 @@ function crepair_content(App $a)
if (DBA::isResult($contact)) { if (DBA::isResult($contact)) {
$a->data['contact'] = $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('<strong>WARNING: This is highly advanced</strong> and if you enter incorrect information your communications with this contact may stop working.'); $warning = DI::l10n()->t('<strong>WARNING: This is highly advanced</strong> and if you enter incorrect information your communications with this contact may stop working.');

View File

@ -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) function display_fetchauthor($a, $item)

View File

@ -192,7 +192,7 @@ function follow_content(App $a)
$profiledata = Contact::getDetailsByURL($ret['url']); $profiledata = Contact::getDetailsByURL($ret['url']);
if ($profiledata) { if ($profiledata) {
Profile::load($a, '', 0, $profiledata, false); Profile::load($a, '', $profiledata, false);
} }
if ($gcontact_id <> 0) { if ($gcontact_id <> 0) {

View File

@ -141,7 +141,7 @@ function unfollow_content(App $a)
]); ]);
DI::page()['aside'] = ''; 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')]); $o .= Renderer::replaceMacros(Renderer::getMarkupTemplate('section_title.tpl'), ['$title' => DI::l10n()->t('Status Messages and Posts')]);

View File

@ -121,13 +121,12 @@ class Profile
* *
* @param App $a * @param App $a
* @param string $nickname string * @param string $nickname string
* @param int $profile_id int
* @param array $profiledata array * @param array $profiledata array
* @param boolean $show_connect Show connect link * @param boolean $show_connect Show connect link
* @throws \Friendica\Network\HTTPException\InternalServerErrorException * @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @throws \ImagickException * @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]); $user = DBA::selectFirst('user', ['uid'], ['nickname' => $nickname, 'account_removed' => false]);

View File

@ -44,7 +44,7 @@ class AllFriends extends BaseModule
} }
DI::page()['aside'] = ""; 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); $total = Model\GContact::countAllFriends(local_user(), $cid);

View File

@ -957,7 +957,7 @@ class Contact extends BaseModule
$profiledata = Model\Contact::getDetailsByURL($contact['url']); $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); $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']); $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']); $o .= Model\Contact::getPostsFromUrl($contact['url']);
} }

View File

@ -21,16 +21,14 @@ class HoverCard extends BaseModule
if ((local_user()) && ($parameters['action'] ?? '') === 'view') { if ((local_user()) && ($parameters['action'] ?? '') === 'view') {
// A logged in user views a profile of a user // A logged in user views a profile of a user
$nickname = $a->user['nickname']; $nickname = $a->user['nickname'];
$profile = $parameters['profile'];
} elseif (empty($parameters['action'])) { } elseif (empty($parameters['action'])) {
// Show the profile hovercard // Show the profile hovercard
$nickname = $parameters['profile']; $nickname = $parameters['profile'];
$profile = 0;
} else { } else {
throw new NotFoundException(DI::l10n()->t('No profile')); throw new NotFoundException(DI::l10n()->t('No profile'));
} }
Profile::load($a, $nickname, $profile); Profile::load($a, $nickname);
$page = DI::page(); $page = DI::page();

View File

@ -25,17 +25,15 @@ class NoScrape extends BaseModule
if (isset($parameters['nick'])) { if (isset($parameters['nick'])) {
// Get infos about a specific nick (public) // Get infos about a specific nick (public)
$which = $parameters['nick']; $which = $parameters['nick'];
$profile = 0;
} elseif (local_user() && isset($parameters['profile']) && DI::args()->get(2) == 'view') { } elseif (local_user() && isset($parameters['profile']) && DI::args()->get(2) == 'view') {
// view infos about a known profile (needs a login) // view infos about a known profile (needs a login)
$which = $a->user['nickname']; $which = $a->user['nickname'];
$profile = $parameters['profile'];
} else { } else {
System::jsonError(403, 'Authentication required'); System::jsonError(403, 'Authentication required');
exit(); exit();
} }
Profile::load($a, $which, $profile); Profile::load($a, $nickname);
$json_info = [ $json_info = [
'addr' => $a->profile['addr'], 'addr' => $a->profile['addr'],