forked from GNUsocial/gnu-social
[ActivityPub] Fix profile url handling
This commit is contained in:
parent
d24075b1c5
commit
f4558e3c41
@ -152,7 +152,7 @@ class Activitypub_profile extends Managed_DataObject
|
|||||||
$profile->created = $this->created = $this->modified = common_sql_now();
|
$profile->created = $this->created = $this->modified = common_sql_now();
|
||||||
|
|
||||||
$fields = [
|
$fields = [
|
||||||
'uri' => 'profileurl',
|
'profileurl' => 'profileurl',
|
||||||
'nickname' => 'nickname',
|
'nickname' => 'nickname',
|
||||||
'fullname' => 'fullname',
|
'fullname' => 'fullname',
|
||||||
'bio' => 'bio'
|
'bio' => 'bio'
|
||||||
@ -454,17 +454,18 @@ class Activitypub_profile extends Managed_DataObject
|
|||||||
// ActivityPub Profile
|
// ActivityPub Profile
|
||||||
$aprofile->uri = $res['id'];
|
$aprofile->uri = $res['id'];
|
||||||
$aprofile->nickname = $res['preferredUsername'];
|
$aprofile->nickname = $res['preferredUsername'];
|
||||||
$aprofile->fullname = isset($res['name']) ? $res['name'] : null;
|
$aprofile->fullname = $res['name'] ?? null;
|
||||||
$aprofile->bio = isset($res['summary']) ? substr(strip_tags($res['summary']), 0, 1000) : null;
|
$aprofile->bio = isset($res['summary']) ? substr(strip_tags($res['summary']), 0, 1000) : null;
|
||||||
$aprofile->inboxuri = $res['inbox'];
|
$aprofile->inboxuri = $res['inbox'];
|
||||||
$aprofile->sharedInboxuri = isset($res['endpoints']['sharedInbox']) ? $res['endpoints']['sharedInbox'] : $res['inbox'];
|
$aprofile->sharedInboxuri = $res['endpoints']['sharedInbox'] ?? $res['inbox'];
|
||||||
|
$aprofile->profileurl = $res['url'] ?? $aprofile->uri;
|
||||||
|
|
||||||
$profile = $aprofile->local_profile();
|
$profile = $aprofile->local_profile();
|
||||||
|
|
||||||
$profile->modified = $aprofile->modified = common_sql_now();
|
$profile->modified = $aprofile->modified = common_sql_now();
|
||||||
|
|
||||||
$fields = [
|
$fields = [
|
||||||
'uri' => 'profileurl',
|
'profileurl' => 'profileurl',
|
||||||
'nickname' => 'nickname',
|
'nickname' => 'nickname',
|
||||||
'fullname' => 'fullname',
|
'fullname' => 'fullname',
|
||||||
'bio' => 'bio'
|
'bio' => 'bio'
|
||||||
|
@ -260,10 +260,11 @@ class Activitypub_explorer
|
|||||||
$aprofile = new Activitypub_profile;
|
$aprofile = new Activitypub_profile;
|
||||||
$aprofile->uri = $res['id'];
|
$aprofile->uri = $res['id'];
|
||||||
$aprofile->nickname = $res['preferredUsername'];
|
$aprofile->nickname = $res['preferredUsername'];
|
||||||
$aprofile->fullname = isset($res['name']) ? $res['name'] : null;
|
$aprofile->fullname = $res['name'] ?? null;
|
||||||
$aprofile->bio = isset($res['summary']) ? substr(strip_tags($res['summary']), 0, 1000) : null;
|
$aprofile->bio = isset($res['summary']) ? substr(strip_tags($res['summary']), 0, 1000) : null;
|
||||||
$aprofile->inboxuri = $res['inbox'];
|
$aprofile->inboxuri = $res['inbox'];
|
||||||
$aprofile->sharedInboxuri = isset($res['endpoints']['sharedInbox']) ? $res['endpoints']['sharedInbox'] : $res['inbox'];
|
$aprofile->sharedInboxuri = $res['endpoints']['sharedInbox'] ?? $res['inbox'];
|
||||||
|
$aprofile->profileurl = $res['url'] ?? $aprofile->uri;
|
||||||
|
|
||||||
$aprofile->do_insert();
|
$aprofile->do_insert();
|
||||||
$profile = $aprofile->local_profile();
|
$profile = $aprofile->local_profile();
|
||||||
|
Loading…
Reference in New Issue
Block a user