diff options
Diffstat (limited to 'app/helpers/profiles_helper.rb')
-rw-r--r-- | app/helpers/profiles_helper.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/helpers/profiles_helper.rb b/app/helpers/profiles_helper.rb index 5a42e581867..04a3b915493 100644 --- a/app/helpers/profiles_helper.rb +++ b/app/helpers/profiles_helper.rb @@ -29,4 +29,18 @@ module ProfilesHelper def user_profile? params[:controller] == 'users' end + + def availability_values + Types::AvailabilityEnum.enum + end + + def user_status_set_to_busy?(status) + status&.availability == availability_values[:busy] + end + + def show_status_emoji?(status) + return false unless status + + status.message.present? || status.emoji != UserStatus::DEFAULT_EMOJI + end end |