discourse/plugins/chat/app/jobs/scheduled/auto_join_users.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
335 B
Ruby
Raw Normal View History

# frozen_string_literal: true
module Jobs
class AutoJoinUsers < ::Jobs::Scheduled
every 1.hour
def execute(_args)
ChatChannel
.where(auto_join_users: true)
.each do |channel|
Chat::ChatChannelMembershipManager.new(channel).enforce_automatic_channel_memberships
end
end
end
end