1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2025-02-21 13:46:55 +00:00

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

View file

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

View file

@ -79,6 +79,7 @@ class LikePipeline implements ShouldQueue
return true; return true;
} }
if($status->uri === null && $status->object_url === null && $status->url === null) {
try { try {
$notification = new Notification(); $notification = new Notification();
$notification->profile_id = $status->profile_id; $notification->profile_id = $status->profile_id;
@ -91,6 +92,7 @@ class LikePipeline implements ShouldQueue
} catch (Exception $e) { } catch (Exception $e) {
} }
} }
}
public function remoteLikeDeliver() 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:' . $reply->id);
Cache::forget('status:replies:all:' . $status->id); Cache::forget('status:replies:all:' . $status->id);
if($target->user_id && $target->domain === null) {
DB::transaction(function() use($target, $actor, $status) { DB::transaction(function() use($target, $actor, $status) {
$notification = new Notification(); $notification = new Notification();
$notification->profile_id = $target->id; $notification->profile_id = $target->id;
@ -99,6 +100,7 @@ class StatusReplyPipeline implements ShouldQueue
NotificationService::setNotification($notification); NotificationService::setNotification($notification);
NotificationService::set($notification->profile_id, $notification->id); NotificationService::set($notification->profile_id, $notification->id);
}); });
}
if($exists = Cache::get('status:replies:all:' . $reply->id)) { if($exists = Cache::get('status:replies:all:' . $reply->id)) {
if($exists && $exists->count() == 3) { if($exists && $exists->count() == 3) {