diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2017-02-01 18:41:17 +0000 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2017-02-01 18:41:17 +0000 |
commit | e27416300fc71e84b5bc901ef7f9e9143b8b940e (patch) | |
tree | e3e92c5cbccc6065caea3d5a8230d6404241aa7d /app/models/project_services | |
parent | 659cceb0e8694b58a8b665de3f338245244ef114 (diff) | |
parent | 164eb3aa37cbcff2c5fbf582c3acdbaa3e6fee77 (diff) | |
download | gitlab-ce-e27416300fc71e84b5bc901ef7f9e9143b8b940e.tar.gz |
Merge branch 'zj-format-chat-messages' into 'master'
Format chat messages
Closes #24917 and #25746
See merge request !8528
Diffstat (limited to 'app/models/project_services')
-rw-r--r-- | app/models/project_services/chat_slash_commands_service.rb | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/app/models/project_services/chat_slash_commands_service.rb b/app/models/project_services/chat_slash_commands_service.rb index 2bcff541cc0..5eb1bd86e9d 100644 --- a/app/models/project_services/chat_slash_commands_service.rb +++ b/app/models/project_services/chat_slash_commands_service.rb @@ -31,13 +31,13 @@ class ChatSlashCommandsService < Service return unless valid_token?(params[:token]) user = find_chat_user(params) - unless user + + if user + Gitlab::ChatCommands::Command.new(project, user, params).execute + else url = authorize_chat_name_url(params) - return presenter.authorize_chat_name(url) + Gitlab::ChatCommands::Presenters::Access.new(url).authorize end - - Gitlab::ChatCommands::Command.new(project, user, - params).execute end private @@ -49,8 +49,4 @@ class ChatSlashCommandsService < Service def authorize_chat_name_url(params) ChatNames::AuthorizeUserService.new(self, params).execute end - - def presenter - Gitlab::ChatCommands::Presenter.new - end end |