Merge pull request #2206 from pixelfed/staging

Update AP Inbox, add follow notifications
This commit is contained in:
daniel 2020-05-24 03:26:07 -06:00 committed by GitHub
commit f5fdd7d31c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 12 deletions

View file

@ -39,7 +39,8 @@
- Updated Inbox, move expensive HTTP Signature validation to job queue ([f2ae45e5a](https://github.com/pixelfed/pixelfed/commit/f2ae45e5a)) - Updated Inbox, move expensive HTTP Signature validation to job queue ([f2ae45e5a](https://github.com/pixelfed/pixelfed/commit/f2ae45e5a))
- Updated MomentUI, fix bugs and improve UI ([90b89cb8](https://github.com/pixelfed/pixelfed/commit/90b89cb8)) - Updated MomentUI, fix bugs and improve UI ([90b89cb8](https://github.com/pixelfed/pixelfed/commit/90b89cb8))
- Updated PostComponent, improve embed model. Fixes ([#2189](https://github.com/pixelfed/pixelfed/issues/2189)) ([b12e504e](https://github.com/pixelfed/pixelfed/commit/b12e504e)) - Updated PostComponent, improve embed model. Fixes ([#2189](https://github.com/pixelfed/pixelfed/issues/2189)) ([b12e504e](https://github.com/pixelfed/pixelfed/commit/b12e504e))
- Updated PostComponent, hide edit button after 24 hours. Fixes [#2188](https://github.com/pixelfed/pixelfed/issues/2188)) ([a1fee6a2](https://github.com/pixelfed/pixelfed/commit/a1fee6a2)) - Updated PostComponent, hide edit button after 24 hours. Fixes ([#2188](https://github.com/pixelfed/pixelfed/issues/2188)) ([a1fee6a2](https://github.com/pixelfed/pixelfed/commit/a1fee6a2))
- Updated AP Inbox, add follow notifications ([b8819fbb](https://github.com/pixelfed/pixelfed/commit/b8819fbb))
## [v0.10.9 (2020-04-17)](https://github.com/pixelfed/pixelfed/compare/v0.10.8...v0.10.9) ## [v0.10.9 (2020-04-17)](https://github.com/pixelfed/pixelfed/compare/v0.10.8...v0.10.9)

View file

@ -197,18 +197,9 @@ class Inbox
$follower->profile_id = $actor->id; $follower->profile_id = $actor->id;
$follower->following_id = $target->id; $follower->following_id = $target->id;
$follower->local_profile = empty($actor->domain); $follower->local_profile = empty($actor->domain);
$follower->save();
if($target->domain == null) { FollowPipeline::dispatch($follower);
Notification::firstOrCreate([
'profile_id' => $target->id,
'actor_id' => $actor->id,
'action' => 'follow',
'message' => $follower->toText(),
'rendered' => $follower->toHtml(),
'item_id' => $target->id,
'item_type' => 'App\Profile'
]);
}
// send Accept to remote profile // send Accept to remote profile
$accept = [ $accept = [
@ -446,6 +437,12 @@ class Inbox
Follower::whereProfileId($profile->id) Follower::whereProfileId($profile->id)
->whereFollowingId($following->id) ->whereFollowingId($following->id)
->delete(); ->delete();
Notification::whereProfileId($following->id)
->whereActorId($profile->id)
->whereAction('follow')
->whereItemId($following->id)
->whereItemType('App\Profile')
->forceDelete();
break; break;
case 'Like': case 'Like':