mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-30 08:53:17 +00:00
Merge pull request #4127 from pixelfed/staging
Update StatusReplyPipeline, fix comment counts
This commit is contained in:
commit
095a71550f
2 changed files with 0 additions and 16 deletions
|
@ -60,14 +60,6 @@ class CommentPipeline implements ShouldQueue
|
|||
$actor = $comment->profile;
|
||||
|
||||
if(config('database.default') === 'mysql') {
|
||||
$count = DB::select(DB::raw("select id, in_reply_to_id from statuses, (select @pv := :kid) initialisation where deleted_at IS NULL and reblog_of_id IS NULL and id > @pv and find_in_set(in_reply_to_id, @pv) > 0 and @pv := concat(@pv, ',', id)"), [ 'kid' => $status->id]);
|
||||
$status->reply_count = count($count);
|
||||
$status->save();
|
||||
|
||||
$count = DB::select(DB::raw("select id, in_reply_to_id from statuses, (select @pv := :kid) initialisation where deleted_at IS NULL and reblog_of_id IS NULL and id > @pv and find_in_set(in_reply_to_id, @pv) > 0 and @pv := concat(@pv, ',', id)"), [ 'kid' => $comment->id]);
|
||||
$comment->reply_count = count($count);
|
||||
$comment->save();
|
||||
} else {
|
||||
$status->reply_count = $status->reply_count + 1;
|
||||
$status->save();
|
||||
}
|
||||
|
|
|
@ -70,14 +70,6 @@ class StatusReplyPipeline implements ShouldQueue
|
|||
}
|
||||
|
||||
if(config('database.default') === 'mysql') {
|
||||
$count = DB::select( DB::raw("select id, in_reply_to_id from statuses, (select @pv := :kid) initialisation where deleted_at IS NULL and reblog_of_id IS NULL and id > @pv and find_in_set(in_reply_to_id, @pv) > 0 and @pv := concat(@pv, ',', id)"), [ 'kid' => $reply->id]);
|
||||
$reply->reply_count = count($count);
|
||||
$reply->save();
|
||||
|
||||
$count = DB::select( DB::raw("select id, in_reply_to_id from statuses, (select @pv := :kid) initialisation where deleted_at IS NULL and reblog_of_id IS NULL and id > @pv and find_in_set(in_reply_to_id, @pv) > 0 and @pv := concat(@pv, ',', id)"), [ 'kid' => $status->id]);
|
||||
$status->reply_count = count($count);
|
||||
$status->save();
|
||||
} else {
|
||||
$reply->reply_count = $reply->reply_count + 1;
|
||||
$reply->save();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue