Ver código fonte

Update PublicApiController, filter out text replies on home timeline

Daniel Supernault 4 anos atrás
pai
commit
86219b57fc
1 arquivos alterados com 2 adições e 0 exclusões
  1. 2 0
      app/Http/Controllers/PublicApiController.php

+ 2 - 0
app/Http/Controllers/PublicApiController.php

@@ -430,6 +430,7 @@ class PublicApiController extends Controller
                       ->where('id', $dir, $id)
                       ->where('id', $dir, $id)
                       ->whereIn('profile_id', $following)
                       ->whereIn('profile_id', $following)
                       ->whereNotIn('profile_id', $filtered)
                       ->whereNotIn('profile_id', $filtered)
+                      ->whereNull('in_reply_to_id')
                       ->whereIn('visibility',['public', 'unlisted', 'private'])
                       ->whereIn('visibility',['public', 'unlisted', 'private'])
                       ->orderBy('created_at', 'desc')
                       ->orderBy('created_at', 'desc')
                       ->limit($limit)
                       ->limit($limit)
@@ -459,6 +460,7 @@ class PublicApiController extends Controller
                       ->with('profile', 'hashtags', 'mentions')
                       ->with('profile', 'hashtags', 'mentions')
                       ->whereIn('profile_id', $following)
                       ->whereIn('profile_id', $following)
                       ->whereNotIn('profile_id', $filtered)
                       ->whereNotIn('profile_id', $filtered)
+                      ->whereNull('in_reply_to_id')
                       ->whereIn('visibility',['public', 'unlisted', 'private'])
                       ->whereIn('visibility',['public', 'unlisted', 'private'])
                       ->orderBy('created_at', 'desc')
                       ->orderBy('created_at', 'desc')
                       ->simplePaginate($limit);
                       ->simplePaginate($limit);