2016-11-13 19:35:47 +00:00
|
|
|
# Base class for Chat services
|
2016-11-14 11:41:14 +00:00
|
|
|
# This class is not meant to be used directly, but only to inherrit from.
|
2016-11-13 19:35:47 +00:00
|
|
|
class ChatService < Service
|
|
|
|
default_value_for :category, 'chat'
|
|
|
|
|
2016-11-14 14:10:35 +00:00
|
|
|
has_many :chat_names, foreign_key: :service_id
|
2016-11-13 19:35:47 +00:00
|
|
|
|
|
|
|
def valid_token?(token)
|
2016-11-14 14:10:35 +00:00
|
|
|
self.respond_to?(:token) &&
|
|
|
|
self.token.present? &&
|
|
|
|
ActiveSupport::SecurityUtils.variable_size_secure_compare(token, self.token)
|
2016-11-13 19:35:47 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def supported_events
|
2016-11-14 14:10:35 +00:00
|
|
|
[]
|
2016-11-13 19:35:47 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def trigger(params)
|
2016-11-14 11:41:14 +00:00
|
|
|
raise NotImplementedError
|
2016-11-13 19:35:47 +00:00
|
|
|
end
|
|
|
|
end
|