diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /app/services/users/set_status_service.rb | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'app/services/users/set_status_service.rb')
-rw-r--r-- | app/services/users/set_status_service.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/services/users/set_status_service.rb b/app/services/users/set_status_service.rb index 89008368d5f..356c8782af1 100644 --- a/app/services/users/set_status_service.rb +++ b/app/services/users/set_status_service.rb @@ -14,7 +14,7 @@ module Users def execute return false unless can?(current_user, :update_user_status, target_user) - if params[:emoji].present? || params[:message].present? + if params[:emoji].present? || params[:message].present? || params[:availability].present? set_status else remove_status @@ -25,6 +25,9 @@ module Users def set_status params[:emoji] = UserStatus::DEFAULT_EMOJI if params[:emoji].blank? + params.delete(:availability) if params[:availability].blank? + return false if params[:availability].present? && UserStatus.availabilities.keys.exclude?(params[:availability]) + user_status.update(params) end |