mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 08:44:49 +00:00
Update Inbox
This commit is contained in:
parent
02e131f3b2
commit
2879e26955
1 changed files with 8 additions and 3 deletions
|
@ -176,7 +176,7 @@ class Inbox
|
||||||
'following_id' => $target->id,
|
'following_id' => $target->id,
|
||||||
'local_profile' => empty($actor->domain)
|
'local_profile' => empty($actor->domain)
|
||||||
]);
|
]);
|
||||||
if($follower->wasRecentlyCreated == true) {
|
if($follower->wasRecentlyCreated == true && $target->domain == null) {
|
||||||
// send notification
|
// send notification
|
||||||
Notification::firstOrCreate([
|
Notification::firstOrCreate([
|
||||||
'profile_id' => $target->id,
|
'profile_id' => $target->id,
|
||||||
|
@ -188,14 +188,19 @@ class Inbox
|
||||||
'item_type' => 'App\Profile'
|
'item_type' => 'App\Profile'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
$payload = $this->payload;
|
|
||||||
// send Accept to remote profile
|
// send Accept to remote profile
|
||||||
$accept = [
|
$accept = [
|
||||||
'@context' => 'https://www.w3.org/ns/activitystreams',
|
'@context' => 'https://www.w3.org/ns/activitystreams',
|
||||||
'id' => $target->permalink().'#accepts/follows/' . $follower->id,
|
'id' => $target->permalink().'#accepts/follows/' . $follower->id,
|
||||||
'type' => 'Accept',
|
'type' => 'Accept',
|
||||||
'actor' => $target->permalink(),
|
'actor' => $target->permalink(),
|
||||||
'object' => $payload
|
'object' => [
|
||||||
|
'id' => $actor->permalink('#follows/' . $follower->id),
|
||||||
|
'actor' => $actor->permalink(),
|
||||||
|
'type' => 'Follow',
|
||||||
|
'object' => $target->permalink()
|
||||||
|
]
|
||||||
];
|
];
|
||||||
Helpers::sendSignedObject($target, $actor->inbox_url, $accept);
|
Helpers::sendSignedObject($target, $actor->inbox_url, $accept);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue