discourse/plugins/discourse-chat-integration/app/services/problem_check/channel_errors.rb
Jarek Radosz e372355fd0
DEV: Clean up scope resolution operators in plugins (#34979)
Co-authored-by: Loïc Guitaut <loic@discourse.org>
2025-09-30 14:36:34 +02:00

20 lines
458 B
Ruby

# frozen_string_literal: true
class ProblemCheck::ChannelErrors < ProblemCheck
self.priority = "low"
def call
return no_problem if !SiteSetting.chat_integration_enabled
return no_problem if !channel_errors?
problem
end
private
def channel_errors?
DiscourseChatIntegration::Channel.find_each.any? do |channel|
channel.error_key.present? && DiscourseChatIntegration::Provider.is_enabled(channel.provider)
end
end
end