Chatwoot/app/models/concerns/availability_statusable.rb
Pranav Raj S 0b31e14132
Feature: Add online status to each user (#452)
* Feature: Add online status to each user
* Add OnlineStatusable, add availability status to thumbnail
2020-02-02 22:49:16 +05:45

11 lines
219 B
Ruby

module AvailabilityStatusable
extend ActiveSupport::Concern
def online?
::OnlineStatusTracker.subscription_count(pubsub_token) != 0
end
def availability_status
online? ? 'online' : 'offline'
end
end