mirror of
https://github.com/friendica/friendica
synced 2024-12-23 12:40:17 +00:00
Changed parameter order for "getbyURLForUser"
This commit is contained in:
parent
fc0312451d
commit
e374aecc46
11 changed files with 14 additions and 14 deletions
|
@ -57,7 +57,7 @@ function common_content(App $a)
|
||||||
|
|
||||||
if (DBA::isResult($contact)) {
|
if (DBA::isResult($contact)) {
|
||||||
DI::page()['aside'] = "";
|
DI::page()['aside'] = "";
|
||||||
Model\Profile::load($a, "", Model\Contact::getByURLForUser($contact["url"], 0, [], false));
|
Model\Profile::load($a, "", Model\Contact::getByURL($contact["url"], false));
|
||||||
}
|
}
|
||||||
} 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]);
|
||||||
|
@ -124,7 +124,7 @@ function common_content(App $a)
|
||||||
$entries = [];
|
$entries = [];
|
||||||
foreach ($common_friends as $common_friend) {
|
foreach ($common_friends as $common_friend) {
|
||||||
//get further details of the contact
|
//get further details of the contact
|
||||||
$contact_details = Model\Contact::getByURLForUser($common_friend['url'], $uid, [], false);
|
$contact_details = Model\Contact::getByURLForUser($common_friend['url'], $uid, false);
|
||||||
|
|
||||||
// $rr['id'] is needed to use contact_photo_menu()
|
// $rr['id'] is needed to use contact_photo_menu()
|
||||||
/// @TODO Adding '/" here avoids E_NOTICE on missing constants
|
/// @TODO Adding '/" here avoids E_NOTICE on missing constants
|
||||||
|
|
|
@ -164,7 +164,7 @@ function display_fetchauthor($a, $item)
|
||||||
$profiledata["about"] = "";
|
$profiledata["about"] = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
$profiledata = array_merge($profiledata, Contact::getByURLForUser($profiledata["url"], local_user(), [], false));
|
$profiledata = array_merge($profiledata, Contact::getByURLForUser($profiledata["url"], local_user(), false));
|
||||||
|
|
||||||
if (!empty($profiledata["photo"])) {
|
if (!empty($profiledata["photo"])) {
|
||||||
$profiledata["photo"] = DI::baseUrl()->remove($profiledata["photo"]);
|
$profiledata["photo"] = DI::baseUrl()->remove($profiledata["photo"]);
|
||||||
|
|
|
@ -104,7 +104,7 @@ function suggest_content(App $a)
|
||||||
'hide' => [DI::l10n()->t('Ignore/Hide'), $ignlnk]
|
'hide' => [DI::l10n()->t('Ignore/Hide'), $ignlnk]
|
||||||
];
|
];
|
||||||
|
|
||||||
$contact_details = array_merge($rr, Contact::getByURLForUser($rr["url"], local_user(), [], false));
|
$contact_details = array_merge($rr, Contact::getByURLForUser($rr["url"], local_user(), false));
|
||||||
|
|
||||||
$entry = [
|
$entry = [
|
||||||
'url' => Contact::magicLink($rr['url']),
|
'url' => Contact::magicLink($rr['url']),
|
||||||
|
|
|
@ -150,7 +150,7 @@ class Item
|
||||||
|
|
||||||
// Try to detect the contact in various ways
|
// Try to detect the contact in various ways
|
||||||
if (strpos($name, 'http://') || strpos($name, '@')) {
|
if (strpos($name, 'http://') || strpos($name, '@')) {
|
||||||
$contact = Contact::getByURLForUser($name, $profile_uid, []);
|
$contact = Contact::getByURLForUser($name, $profile_uid);
|
||||||
} else {
|
} else {
|
||||||
$contact = false;
|
$contact = false;
|
||||||
$fields = ['id', 'url', 'nick', 'name', 'alias', 'network', 'forum', 'prv'];
|
$fields = ['id', 'url', 'nick', 'name', 'alias', 'network', 'forum', 'prv'];
|
||||||
|
|
|
@ -77,7 +77,7 @@ class Search
|
||||||
// Ensure that we do have a contact entry
|
// Ensure that we do have a contact entry
|
||||||
Contact::getIdForURL($user_data['url'] ?? '');
|
Contact::getIdForURL($user_data['url'] ?? '');
|
||||||
|
|
||||||
$contactDetails = Contact::getByURLForUser($user_data['url'] ?? '', local_user(), [], false);
|
$contactDetails = Contact::getByURLForUser($user_data['url'] ?? '', local_user(), false);
|
||||||
|
|
||||||
$result = new ContactResult(
|
$result = new ContactResult(
|
||||||
$user_data['name'] ?? '',
|
$user_data['name'] ?? '',
|
||||||
|
@ -143,7 +143,7 @@ class Search
|
||||||
|
|
||||||
foreach ($profiles as $profile) {
|
foreach ($profiles as $profile) {
|
||||||
$profile_url = $profile['url'] ?? '';
|
$profile_url = $profile['url'] ?? '';
|
||||||
$contactDetails = Contact::getByURLForUser($profile_url, local_user(), [], false);
|
$contactDetails = Contact::getByURLForUser($profile_url, local_user(), false);
|
||||||
|
|
||||||
$result = new ContactResult(
|
$result = new ContactResult(
|
||||||
$profile['name'] ?? '',
|
$profile['name'] ?? '',
|
||||||
|
@ -232,7 +232,7 @@ class Search
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$contact = Contact::getByURLForUser($row["nurl"], local_user(), [], false);
|
$contact = Contact::getByURLForUser($row["nurl"], local_user(), false);
|
||||||
|
|
||||||
if ($contact["name"] == "") {
|
if ($contact["name"] == "") {
|
||||||
$contact["name"] = end(explode("/", $urlParts["path"]));
|
$contact["name"] = end(explode("/", $urlParts["path"]));
|
||||||
|
|
|
@ -238,7 +238,7 @@ class Contact
|
||||||
* @param boolean $update true = always update, false = never update, null = update when not found or outdated
|
* @param boolean $update true = always update, false = never update, null = update when not found or outdated
|
||||||
* @return array contact array
|
* @return array contact array
|
||||||
*/
|
*/
|
||||||
public static function getByURLForUser(string $url, int $uid = 0, array $fields = [], $update = null)
|
public static function getByURLForUser(string $url, int $uid = 0, $update = null, array $fields = [])
|
||||||
{
|
{
|
||||||
if ($uid != 0) {
|
if ($uid != 0) {
|
||||||
$contact = self::getByURL($url, $update, $fields, $uid);
|
$contact = self::getByURL($url, $update, $fields, $uid);
|
||||||
|
|
|
@ -111,7 +111,7 @@ class GContact
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcontacts[] = Contact::getByURLForUser($result['nurl'], local_user(), [], false);
|
$gcontacts[] = Contact::getByURLForUser($result['nurl'], local_user(), false);
|
||||||
}
|
}
|
||||||
DBA::close($results);
|
DBA::close($results);
|
||||||
return $gcontacts;
|
return $gcontacts;
|
||||||
|
|
|
@ -79,7 +79,7 @@ class AllFriends extends BaseModule
|
||||||
$entries = [];
|
$entries = [];
|
||||||
foreach ($friends as $friend) {
|
foreach ($friends as $friend) {
|
||||||
//get further details of the contact
|
//get further details of the contact
|
||||||
$contactDetails = array_merge($friend, Model\Contact::getByURLForUser($friend['url'], $uid, [], false));
|
$contactDetails = array_merge($friend, Model\Contact::getByURLForUser($friend['url'], $uid, false));
|
||||||
|
|
||||||
$connlnk = '';
|
$connlnk = '';
|
||||||
// $friend[cid] is only available for common contacts. So if the contact is a common one, use contact_photo_menu to generate the photoMenu
|
// $friend[cid] is only available for common contacts. So if the contact is a common one, use contact_photo_menu to generate the photoMenu
|
||||||
|
|
|
@ -65,7 +65,7 @@ class Hovercard extends BaseModule
|
||||||
// Search for contact data
|
// Search for contact data
|
||||||
// Look if the local user has got the contact
|
// Look if the local user has got the contact
|
||||||
if (Session::isAuthenticated()) {
|
if (Session::isAuthenticated()) {
|
||||||
$contact = Contact::getByURLForUser($contact_url, local_user(), [], false);
|
$contact = Contact::getByURLForUser($contact_url, local_user(), false);
|
||||||
} else {
|
} else {
|
||||||
$contact = Contact::getByURL($contact_url, false);
|
$contact = Contact::getByURL($contact_url, false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,7 +103,7 @@ class Contacts extends BaseProfile
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$contact_details = array_merge($contact, Contact::getByURLForUser($contact['url'], $a->profile['uid'], [], false));
|
$contact_details = array_merge($contact, Contact::getByURLForUser($contact['url'], $a->profile['uid'], false));
|
||||||
|
|
||||||
$contacts[] = [
|
$contacts[] = [
|
||||||
'id' => $contact['id'],
|
'id' => $contact['id'],
|
||||||
|
|
|
@ -755,7 +755,7 @@ class DFRN
|
||||||
{
|
{
|
||||||
$author = $doc->createElement($element);
|
$author = $doc->createElement($element);
|
||||||
|
|
||||||
$contact = Contact::getByURLForUser($contact_url, $item["uid"], ['url', 'name', 'addr', 'photo']);
|
$contact = Contact::getByURLForUser($contact_url, $item["uid"], null, ['url', 'name', 'addr', 'photo']);
|
||||||
if (!empty($contact)) {
|
if (!empty($contact)) {
|
||||||
XML::addElement($doc, $author, "name", $contact["name"]);
|
XML::addElement($doc, $author, "name", $contact["name"]);
|
||||||
XML::addElement($doc, $author, "uri", $contact["url"]);
|
XML::addElement($doc, $author, "uri", $contact["url"]);
|
||||||
|
|
Loading…
Reference in a new issue