chat_service.rb 556 Bytes
Newer Older
1
# Base class for Chat services
2
# This class is not meant to be used directly, but only to inherrit from.
3
4
5
class ChatService < Service
  default_value_for :category, 'chat'

6
  has_many :chat_names, foreign_key: :service_id
7
8

  def valid_token?(token)
9
10
11
    self.respond_to?(:token) &&
      self.token.present? &&
      ActiveSupport::SecurityUtils.variable_size_secure_compare(token, self.token)
12
13
14
  end

  def supported_events
15
    []
16
17
18
  end

  def trigger(params)
19
    raise NotImplementedError
20
21
22
23
24
25
  end

  def chat_user_params(params)
    params.permit()
  end
end