summaryrefslogtreecommitdiff
path: root/app/models/project_services/chat_service.rb
blob: 574788462deddcc160b75a23b2c8b494640d4682 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Base class for Chat services
# This class is not meant to be used directly, but only to inherit from.
class ChatService < Service
  default_value_for :category, 'chat'

  has_many :chat_names, foreign_key: :service_id

  def valid_token?(token)
    self.respond_to?(:token) &&
      self.token.present? &&
      ActiveSupport::SecurityUtils.variable_size_secure_compare(token, self.token)
  end

  def supported_events
    []
  end

  def trigger(params)
    raise NotImplementedError
  end
end