Browse Source

Merge pull request #2846 from pixelfed/staging

Update StatusEntityLexer, only add specific status types to PublicTimelineService
daniel 4 years ago
parent
commit
a35759cef1
2 changed files with 10 additions and 2 deletions
  1. 1 0
      CHANGELOG.md
  2. 9 2
      app/Jobs/StatusPipeline/StatusEntityLexer.php

+ 1 - 0
CHANGELOG.md

@@ -51,6 +51,7 @@
 - Updated Profile, fix unauthenticated private profiles. ([9017f7c4](https://github.com/pixelfed/pixelfed/commit/9017f7c4))
 - Updated PublicApiController, impr home timeline perf. ([4fe42e5b](https://github.com/pixelfed/pixelfed/commit/4fe42e5b))
 - Updated Timeline.vue, fix comment button. ([b6b5ce7c](https://github.com/pixelfed/pixelfed/commit/b6b5ce7c))
+- Updated StatusEntityLexer, only add specific status types to PublicTimelineService. ([1fdcbe5b](https://github.com/pixelfed/pixelfed/commit/1fdcbe5b))
 -  ([](https://github.com/pixelfed/pixelfed/commit/))
 
 ## [v0.11.0 (2021-06-01)](https://github.com/pixelfed/pixelfed/compare/v0.10.10...v0.11.0)

+ 9 - 2
app/Jobs/StatusPipeline/StatusEntityLexer.php

@@ -150,17 +150,24 @@ class StatusEntityLexer implements ShouldQueue
 	public function deliver()
 	{
 		$status = $this->status;
+		$types = [
+			'photo',
+			'photo:album',
+			'video',
+			'video:album',
+			'photo:video:album'
+		];
 
 		if(config_cache('pixelfed.bouncer.enabled')) {
 			Bouncer::get($status);
 		}
 
-		if($status->uri == null && $status->scope == 'public') {
+		if($status->uri == null && $status->scope == 'public' && in_array($status->type, $types)) {
 			PublicTimelineService::add($status->id);
 		}
 
 		if(config_cache('federation.activitypub.enabled') == true && config('app.env') == 'production') {
-			StatusActivityPubDeliver::dispatch($this->status);
+			StatusActivityPubDeliver::dispatch($status);
 		}
 	}
 }