kopia lustrzana https://github.com/friendica/friendica
Don't probe non existing local contacts
rodzic
aa6313dee6
commit
01abea7c25
|
@ -2201,20 +2201,9 @@ class Probe
|
||||||
*/
|
*/
|
||||||
private static function localProbe(string $url)
|
private static function localProbe(string $url)
|
||||||
{
|
{
|
||||||
$uid = User::getIdForURL($url);
|
if ($uid = User::getIdForURL($url)) {
|
||||||
if (empty($uid)) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
$profile = User::getOwnerDataById($uid);
|
$profile = User::getOwnerDataById($uid);
|
||||||
if (empty($profile)) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
$approfile = ActivityPub\Transmitter::getProfile($uid);
|
$approfile = ActivityPub\Transmitter::getProfile($uid);
|
||||||
if (empty($approfile)) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (empty($profile['gsid'])) {
|
if (empty($profile['gsid'])) {
|
||||||
$profile['gsid'] = GServer::getID($approfile['generator']['url']);
|
$profile['gsid'] = GServer::getID($approfile['generator']['url']);
|
||||||
|
@ -2234,6 +2223,11 @@ class Probe
|
||||||
'sharedinbox' => $approfile['endpoints']['sharedInbox'], 'network' => Protocol::DFRN,
|
'sharedinbox' => $approfile['endpoints']['sharedInbox'], 'network' => Protocol::DFRN,
|
||||||
'pubkey' => $profile['upubkey'], 'baseurl' => $approfile['generator']['url'], 'gsid' => $profile['gsid'],
|
'pubkey' => $profile['upubkey'], 'baseurl' => $approfile['generator']['url'], 'gsid' => $profile['gsid'],
|
||||||
'manually-approve' => in_array($profile['page-flags'], [User::PAGE_FLAGS_NORMAL, User::PAGE_FLAGS_PRVGROUP])];
|
'manually-approve' => in_array($profile['page-flags'], [User::PAGE_FLAGS_NORMAL, User::PAGE_FLAGS_PRVGROUP])];
|
||||||
|
} else {
|
||||||
|
// Default values for non existing targets
|
||||||
|
$data = ['name' => $url, 'nick' => $url, 'url' => $url, 'network' => Protocol::PHANTOM,
|
||||||
|
'photo' => DI::baseUrl() . Contact::DEFAULT_AVATAR_PHOTO];
|
||||||
|
}
|
||||||
return self::rearrangeData($data);
|
return self::rearrangeData($data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue