2022-11-02 09:41:30 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class Chat::Api < Chat::ChatBaseController
|
|
|
|
before_action :ensure_logged_in
|
|
|
|
before_action :ensure_can_chat
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def ensure_can_chat
|
|
|
|
raise Discourse::NotFound unless SiteSetting.chat_enabled
|
2022-12-12 18:14:17 -05:00
|
|
|
guardian.ensure_can_chat!
|
2022-11-02 09:41:30 -04:00
|
|
|
end
|
|
|
|
end
|