mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-12 16:51:14 -05:00
f0a122a66c
introduce new setting email_always, that will force emails to send to users regardless of presence on site
15 lines
406 B
Ruby
15 lines
406 B
Ruby
module Jobs
|
|
class CloseTopic < Jobs::Base
|
|
|
|
def execute(args)
|
|
topic = Topic.where(id: args[:topic_id]).first
|
|
if topic and topic.auto_close_at and !topic.closed? and !topic.deleted_at
|
|
closer = User.where(id: args[:user_id]).first
|
|
if Guardian.new(closer).can_moderate?(topic)
|
|
topic.update_status('autoclosed', true, closer)
|
|
end
|
|
end
|
|
end
|
|
|
|
end
|
|
end
|