FIX: Unassign topics if there are no more flags to handle
This commit is contained in:
parent
4b91799bed
commit
8ee1cbd697
10
plugin.rb
10
plugin.rb
|
@ -206,6 +206,16 @@ after_initialize do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Unassign if there are no more flags in the topic
|
||||||
|
on(:flag_reviewed) do |post|
|
||||||
|
if SiteSetting.assign_locks_flags? &&
|
||||||
|
FlagQuery.flagged_post_actions(topic_id: post.topic_id).count == 0
|
||||||
|
|
||||||
|
assigner = ::TopicAssigner.new(post.topic, Discourse.system_user)
|
||||||
|
assigner.unassign
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
on(:move_to_inbox) do |info|
|
on(:move_to_inbox) do |info|
|
||||||
if SiteSetting.unassign_on_group_archive && info[:group]
|
if SiteSetting.unassign_on_group_archive && info[:group]
|
||||||
if topic = info[:topic]
|
if topic = info[:topic]
|
||||||
|
|
Loading…
Reference in New Issue