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
46d0bfdc
Commit
46d0bfdc
authored
Jul 26, 2017
by
http://jneen.net/
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use intersection and diff operators instead of each
parent
651f50ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
22 deletions
+2
-22
app/services/notification_recipient_service.rb
app/services/notification_recipient_service.rb
+2
-22
No files found.
app/services/notification_recipient_service.rb
View file @
46d0bfdc
...
@@ -157,35 +157,15 @@ module NotificationRecipientService
...
@@ -157,35 +157,15 @@ module NotificationRecipientService
user_ids
=
user_ids_notifiable_on
(
project
,
:watch
)
user_ids
=
user_ids_notifiable_on
(
project
,
:watch
)
# If project setting is global, add to watch list if global setting is watch
# If project setting is global, add to watch list if global setting is watch
global_setting
.
each
do
|
user_id
|
user_ids
+
(
global_setting
&
user_ids_global_level_watch
)
if
user_ids_global_level_watch
.
include?
(
user_id
)
user_ids
<<
user_id
end
end
user_ids
end
end
# Build a list of user_ids based on group notification settings
# Build a list of user_ids based on group notification settings
def
select_group_members_ids
(
group
,
project_members
,
global_setting
,
user_ids_global_level_watch
)
def
select_group_members_ids
(
group
,
project_members
,
global_setting
,
user_ids_global_level_watch
)
uids
=
user_ids_notifiable_on
(
group
,
:watch
)
uids
=
user_ids_notifiable_on
(
group
,
:watch
)
# Group setting is watch, add to user_ids list if user is not project member
user_ids
=
[]
uids
.
each
do
|
user_id
|
if
project_members
.
exclude?
(
user_id
)
user_ids
<<
user_id
end
end
# Group setting is global, add to user_ids list if global setting is watch
# Group setting is global, add to user_ids list if global setting is watch
global_setting
.
each
do
|
user_id
|
uids
+
(
global_setting
&
user_ids_global_level_watch
)
-
project_members
if
project_members
.
exclude?
(
user_id
)
&&
user_ids_global_level_watch
.
include?
(
user_id
)
user_ids
<<
user_id
end
end
user_ids
end
end
def
user_ids_with_global_level_watch
(
ids
)
def
user_ids_with_global_level_watch
(
ids
)
...
...
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