FIX notifications for flag PMs (#6641)

FIX notifications for flag PMs (#6641)

From 993d8f346e3030fd1ad148ce55fe468371215e03 Mon Sep 17 00:00:00 2001
From: Maja Komel <maja.komel@gmail.com>
Date: Thu, 22 Nov 2018 03:25:19 +0100
Subject: [PATCH] FIX notifications for flag PMs (#6641)


diff --git a/lib/post_destroyer.rb b/lib/post_destroyer.rb
index 617cc77..7336e98 100644
--- a/lib/post_destroyer.rb
+++ b/lib/post_destroyer.rb
@@ -133,7 +133,6 @@ class PostDestroyer
         Topic.reset_highest(@post.topic_id)
       end
       trash_public_post_actions
-      agree_with_flags
       trash_user_actions
       @post.update_flagged_posts_count
       remove_associated_replies
@@ -147,6 +146,9 @@ class PostDestroyer
       update_associated_category_latest_topic
       update_user_counts
       TopicUser.update_post_action_cache(post_id: @post.id)
+      DB.after_commit do
+        agree_with_flags
+      end
     end
 
     feature_users_in_the_topic if @post.topic

GitHub

2 Likes

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

FIX: fix notifications for flag PMs and show topics with moderator posts in inbox (#7331)