mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: automatically sync "move to inbox" / "archive" state on messages
This commit is contained in:
@@ -276,8 +276,13 @@ class PostCreator
|
||||
def unarchive_message
|
||||
return unless @topic.private_message? && @topic.id
|
||||
|
||||
UserArchivedMessage.where(topic_id: @topic.id).destroy_all
|
||||
GroupArchivedMessage.where(topic_id: @topic.id).destroy_all
|
||||
UserArchivedMessage.where(topic_id: @topic.id).pluck(:user_id).each do |user_id|
|
||||
UserArchivedMessage.move_to_inbox!(user_id, @topic.id)
|
||||
end
|
||||
|
||||
GroupArchivedMessage.where(topic_id: @topic.id).pluck(:group_id).each do |group_id|
|
||||
GroupArchivedMessage.move_to_inbox!(group_id, @topic.id)
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
Reference in New Issue
Block a user