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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
e3e41e2c
Commit
e3e41e2c
authored
Feb 23, 2021
by
Kerri Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract #notify_if_mentions_added method
parent
0d93f8a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
10 deletions
+13
-10
app/services/merge_requests/update_service.rb
app/services/merge_requests/update_service.rb
+13
-10
No files found.
app/services/merge_requests/update_service.rb
View file @
e3e41e2c
...
...
@@ -61,16 +61,7 @@ module MergeRequests
track_title_and_desc_edits
(
changed_fields
)
notify_if_labels_added
(
merge_request
,
old_labels
)
added_mentions
=
merge_request
.
mentioned_users
(
current_user
)
-
old_mentioned_users
if
added_mentions
.
present?
notification_service
.
async
.
new_mentions_in_merge_request
(
merge_request
,
added_mentions
,
current_user
)
end
notify_if_mentions_added
(
merge_request
,
old_mentioned_users
)
# Since #mark_as_unchecked triggers an update action through the MR's
# state machine, we want to push this as far down in the process so we
...
...
@@ -129,6 +120,18 @@ module MergeRequests
)
end
def
notify_if_mentions_added
(
merge_request
,
old_mentioned_users
)
added_mentions
=
merge_request
.
mentioned_users
(
current_user
)
-
old_mentioned_users
return
unless
added_mentions
.
present?
notification_service
.
async
.
new_mentions_in_merge_request
(
merge_request
,
added_mentions
,
current_user
)
end
def
handle_draft_status_change
(
merge_request
,
changed_fields
)
return
unless
changed_fields
.
include?
(
"title"
)
...
...
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