Update notification pipelines, fix non-local saving

This commit is contained in:
Daniel Supernault 2024-02-04 07:18:05 -07:00
parent 4d4013896c
commit fa97a1f38e
No known key found for this signature in database
GPG key ID: 23740873EE6F76A1
4 changed files with 50 additions and 42 deletions

View file

@ -91,6 +91,7 @@ class CommentPipeline implements ShouldQueue
return;
}
if($target->user_id && $target->domain === null) {
DB::transaction(function() use($target, $actor, $comment) {
$notification = new Notification();
$notification->profile_id = $target->id;
@ -104,6 +105,7 @@ class CommentPipeline implements ShouldQueue
NotificationService::set($notification->profile_id, $notification->id);
StatusService::del($comment->id);
});
}
if($exists = Cache::get('status:replies:all:' . $status->id)) {
if($exists && $exists->count() == 3) {

View file

@ -72,6 +72,7 @@ class FollowPipeline implements ShouldQueue
$target->save();
AccountService::del($target->id);
if($target->user_id && $target->domain === null) {
try {
$notification = new Notification();
$notification->profile_id = $target->id;
@ -84,4 +85,5 @@ class FollowPipeline implements ShouldQueue
Log::error($e);
}
}
}
}

View file

@ -79,6 +79,7 @@ class LikePipeline implements ShouldQueue
return true;
}
if($status->uri === null && $status->object_url === null && $status->url === null) {
try {
$notification = new Notification();
$notification->profile_id = $status->profile_id;
@ -91,6 +92,7 @@ class LikePipeline implements ShouldQueue
} catch (Exception $e) {
}
}
}
public function remoteLikeDeliver()
{

View file

@ -87,6 +87,7 @@ class StatusReplyPipeline implements ShouldQueue
Cache::forget('status:replies:all:' . $reply->id);
Cache::forget('status:replies:all:' . $status->id);
if($target->user_id && $target->domain === null) {
DB::transaction(function() use($target, $actor, $status) {
$notification = new Notification();
$notification->profile_id = $target->id;
@ -99,6 +100,7 @@ class StatusReplyPipeline implements ShouldQueue
NotificationService::setNotification($notification);
NotificationService::set($notification->profile_id, $notification->id);
});
}
if($exists = Cache::get('status:replies:all:' . $reply->id)) {
if($exists && $exists->count() == 3) {