summaryrefslogtreecommitdiff
path: root/app/models/project_services/mattermost_slash_commands_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/project_services/mattermost_slash_commands_service.rb')
-rw-r--r--app/models/project_services/mattermost_slash_commands_service.rb11
1 files changed, 4 insertions, 7 deletions
diff --git a/app/models/project_services/mattermost_slash_commands_service.rb b/app/models/project_services/mattermost_slash_commands_service.rb
index 51de80f38de..accf59bea18 100644
--- a/app/models/project_services/mattermost_slash_commands_service.rb
+++ b/app/models/project_services/mattermost_slash_commands_service.rb
@@ -25,18 +25,15 @@ class MattermostSlashCommandsService < ChatService
]
end
- def configure!(current_user, params)
- token = Mattermost::Session.new(current_user).with_session do |session|
- Mattermost::Command.create(session, command(params))
- end
+ def configure!(user, params)
+ token = Mattermost::Command.new(user).
+ create(command(params))
update!(active: true, token: token)
end
def list_teams(user)
- Mattermost::Session.new(user).with_session do |session|
- Mattermost::Team.all(session)
- end
+ Mattermost::Team.new(user).all
end
def trigger(params)