Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
e6842ff5
Commit
e6842ff5
authored
Dec 19, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve code design
parent
f5ff3721
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
app/models/project_services/chat_slash_commands_service.rb
app/models/project_services/chat_slash_commands_service.rb
+1
-1
app/models/project_services/slack_slash_commands_service.rb
app/models/project_services/slack_slash_commands_service.rb
+7
-5
No files found.
app/models/project_services/chat_slash_commands_service.rb
View file @
e6842ff5
...
...
@@ -28,7 +28,7 @@ class ChatSlashCommandsService < Service
end
def
trigger
(
params
)
return
nil
unless
valid_token?
(
params
[
:token
])
return
unless
valid_token?
(
params
[
:token
])
user
=
find_chat_user
(
params
)
unless
user
...
...
app/models/project_services/slack_slash_commands_service.rb
View file @
e6842ff5
...
...
@@ -14,13 +14,15 @@ class SlackSlashCommandsService < ChatSlashCommandsService
end
def
trigger
(
params
)
result
=
super
# Format messages to be Slack-compatible
if
result
&&
result
[
:text
]
result
[
:text
]
=
Slack
::
Notifier
::
LinkFormatter
.
format
(
result
[
:text
])
super
.
tap
do
|
result
|
result
[
:text
]
=
format
(
result
[
:text
])
end
end
private
result
def
format
(
text
)
Slack
::
Notifier
::
LinkFormatter
.
format
(
text
)
if
text
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment