mirror of
https://github.com/pixelfed/pixelfed.git
synced 2025-01-26 00:39:40 +00:00
Update AP Helpers
This commit is contained in:
parent
154a6444e2
commit
2147c215d2
1 changed files with 3 additions and 3 deletions
|
@ -281,11 +281,11 @@ class Helpers {
|
|||
public static function profileFirstOrNew($url, $runJobs = false)
|
||||
{
|
||||
$res = self::fetchProfileFromUrl($url);
|
||||
$domain = parse_url($res['url'], PHP_URL_HOST);
|
||||
$domain = parse_url($res['id'], PHP_URL_HOST);
|
||||
$username = $res['preferredUsername'];
|
||||
$remoteUsername = "@{$username}@{$domain}";
|
||||
|
||||
$profile = Profile::whereRemoteUrl($res['url'])->first();
|
||||
$profile = Profile::whereRemoteUrl($res['id'])->first();
|
||||
if(!$profile) {
|
||||
$profile = new Profile;
|
||||
$profile->domain = $domain;
|
||||
|
@ -295,7 +295,7 @@ class Helpers {
|
|||
$profile->sharedInbox = isset($res['endpoints']) && isset($res['endpoints']['sharedInbox']) ? $res['endpoints']['sharedInbox'] : null;
|
||||
$profile->inbox_url = $res['inbox'];
|
||||
$profile->outbox_url = $res['outbox'];
|
||||
$profile->remote_url = $res['url'];
|
||||
$profile->remote_url = $res['id'];
|
||||
$profile->public_key = $res['publicKey']['publicKeyPem'];
|
||||
$profile->key_id = $res['publicKey']['id'];
|
||||
$profile->save();
|
||||
|
|
Loading…
Reference in a new issue