FIX: Make post notices invisible to poster.

FIX: Make post notices invisible to poster.

diff --git a/app/serializers/post_serializer.rb b/app/serializers/post_serializer.rb
index 3f65da2..f345664 100644
--- a/app/serializers/post_serializer.rb
+++ b/app/serializers/post_serializer.rb
@@ -370,7 +370,7 @@ class PostSerializer < BasicPostSerializer
   end
 
   def include_post_notice_type?
-    return false if scope.user&.id != object.user_id && !scope.user&.has_trust_level?(TrustLevel[2])
+    return false if scope.user&.id == object.user_id || !scope.user&.has_trust_level?(TrustLevel[2])
 
     post_notice_type.present?
   end
diff --git a/spec/serializers/post_serializer_spec.rb b/spec/serializers/post_serializer_spec.rb
index 4925b79..649f1ec 100644
--- a/spec/serializers/post_serializer_spec.rb
+++ b/spec/serializers/post_serializer_spec.rb
@@ -193,7 +193,7 @@ describe PostSerializer do
 
     it "will not show for poster and TL2+ users" do
       expect(json_for_user(nil)[:post_notice_type]).to eq(nil)
-      expect(json_for_user(user)[:post_notice_type]).to eq("returning")
+      expect(json_for_user(user)[:post_notice_type]).to eq(nil)
       expect(json_for_user(user_tl1)[:post_notice_type]).to eq(nil)
       expect(json_for_user(user_tl2)[:post_notice_type]).to eq("returning")
     end

GitHub sha: ceec11a1

1 Like

This commit has been mentioned on Discourse Meta. There might be relevant details there: