mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: update 'posted' column on post owner change (#16367)
Fixes the issue where making a user x as owner of a post doesn't cause the concerned topic to be listed in new owner's `My Posts` top menu filter per https://meta.discourse.org/t/199369
This commit is contained in:
@@ -28,7 +28,7 @@ class PostOwnerChanger
|
||||
PostActionDestroyer.destroy(@new_owner, post, :like, skip_delete_check: true)
|
||||
|
||||
level = post.is_first_post? ? :watching : :tracking
|
||||
TopicUser.change(@new_owner.id, @topic.id, notification_level: NotificationLevels.topic_levels[level])
|
||||
TopicUser.change(@new_owner.id, @topic.id, notification_level: NotificationLevels.topic_levels[level], posted: true)
|
||||
|
||||
if post == @topic.posts.order("post_number DESC").where("NOT hidden AND posts.deleted_at IS NULL").first
|
||||
@topic.last_poster = @new_owner
|
||||
|
||||
Reference in New Issue
Block a user