1
0
Fork 0

Replaced "getDetailsByURL" with "getByURL/getByURLForUser"

This commit is contained in:
Michael 2020-07-15 04:42:04 +00:00
commit d9c6a46ffe
29 changed files with 78 additions and 285 deletions

View file

@ -57,7 +57,7 @@ function common_content(App $a)
if (DBA::isResult($contact)) {
DI::page()['aside'] = "";
Model\Profile::load($a, "", Model\Contact::getDetailsByURL($contact["url"]));
Model\Profile::load($a, "", Model\Contact::getByURLForUser($contact["url"], 0, [], false));
}
} else {
$contact = DBA::selectFirst('contact', ['name', 'url', 'photo', 'uid', 'id'], ['self' => true, 'uid' => $uid]);
@ -124,7 +124,7 @@ function common_content(App $a)
$entries = [];
foreach ($common_friends as $common_friend) {
//get further details of the contact
$contact_details = Model\Contact::getDetailsByURL($common_friend['url'], $uid);
$contact_details = Model\Contact::getByURLForUser($common_friend['url'], $uid, [], false);
// $rr['id'] is needed to use contact_photo_menu()
/// @TODO Adding '/" here avoids E_NOTICE on missing constants

View file

@ -164,7 +164,7 @@ function display_fetchauthor($a, $item)
$profiledata["about"] = "";
}
$profiledata = Contact::getDetailsByURL($profiledata["url"], local_user(), $profiledata);
$profiledata = array_merge($profiledata, Contact::getByURLForUser($profiledata["url"], local_user(), [], false));
if (!empty($profiledata["photo"])) {
$profiledata["photo"] = DI::baseUrl()->remove($profiledata["photo"]);

View file

@ -145,7 +145,7 @@ function undo_post_tagging($s) {
if ($cnt) {
foreach ($matches as $mtch) {
if (in_array($mtch[1], ['!', '@'])) {
$contact = Contact::getDetailsByURL($mtch[2]);
$contact = Contact::getByURL($mtch[2], 0, ['addr'], false);
$mtch[3] = empty($contact['addr']) ? $mtch[2] : $contact['addr'];
}
$s = str_replace($mtch[0], $mtch[1] . $mtch[3],$s);

View file

@ -102,7 +102,7 @@ function match_content(App $a)
'follow' => [DI::l10n()->t("Connect/Follow"), $connlnk]
];
$contact_details = Contact::getDetailsByURL($profile->url, 0);
$contact_details = Contact::getByURL($profile->url, 0, [], false);
$entry = [
'url' => Contact::magicLink($profile->url),

View file

@ -396,7 +396,7 @@ function message_content(App $a)
$body_e = BBCode::convert($message['body']);
$to_name_e = $message['name'];
$contact = Contact::getDetailsByURL($message['from-url']);
$contact = Contact::getByURL($message['from-url'], 0, ['thumb', 'addr'], false);
if (isset($contact["thumb"])) {
$from_photo = $contact["thumb"];
} else {
@ -528,7 +528,7 @@ function render_messages(array $msg, $t)
$body_e = $rr['body'];
$to_name_e = $rr['name'];
$contact = Contact::getDetailsByURL($rr['url']);
$contact = Contact::getByURL($rr['url'], 0, ['thumb', 'addr'], false);
if (isset($contact["thumb"])) {
$from_photo = $contact["thumb"];
} else {

View file

@ -331,7 +331,7 @@ function ping_init(App $a)
if (DBA::isResult($notifs)) {
foreach ($notifs as $notif) {
$contact = Contact::getDetailsByURL($notif['url']);
$contact = Contact::getByURL($notif['url'], 0, ['micro'], false);
if (isset($contact['micro'])) {
$notif['photo'] = ProxyUtils::proxifyUrl($contact['micro'], false, ProxyUtils::SIZE_MICRO);
} else {

View file

@ -104,7 +104,7 @@ function suggest_content(App $a)
'hide' => [DI::l10n()->t('Ignore/Hide'), $ignlnk]
];
$contact_details = Contact::getDetailsByURL($rr["url"], local_user(), $rr);
$contact_details = array_merge($rr, Contact::getByURLForUser($rr["url"], local_user(), [], false));
$entry = [
'url' => Contact::magicLink($rr['url']),

View file

@ -146,7 +146,7 @@ function unfollow_content(App $a)
]);
DI::page()['aside'] = '';
Profile::load($a, '', Contact::getDetailsByURL($contact['url']));
Profile::load($a, '', Contact::getByURL($contact['url'], 0, [], false));
$o .= Renderer::replaceMacros(Renderer::getMarkupTemplate('section_title.tpl'), ['$title' => DI::l10n()->t('Status Messages and Posts')]);