Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
93096247
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
93096247
编写于
1月 04, 2016
作者:
S
Stan Hu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Don't notify users twice if they are both project watchers and subscribers
Closes #4708
上级
6f4ea679
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
14 addition
and
0 deletion
+14
-0
CHANGELOG
CHANGELOG
+1
-0
app/services/notification_service.rb
app/services/notification_service.rb
+1
-0
spec/services/notification_service_spec.rb
spec/services/notification_service_spec.rb
+12
-0
未找到文件。
CHANGELOG
浏览文件 @
93096247
...
...
@@ -2,6 +2,7 @@ Please view this file on the master branch, on stable branches it's out of date.
v 8.4.0 (unreleased)
- Expire view caches when application settings change (e.g. Gravatar disabled) (Stan Hu)
- Don't notify users twice if they are both project watchers and subscribers (Stan Hu)
- Implement new UI for group page
- Implement search inside emoji picker
- Add API support for looking up a user by username (Stan Hu)
...
...
app/services/notification_service.rb
浏览文件 @
93096247
...
...
@@ -413,6 +413,7 @@ class NotificationService
recipients
=
reject_unsubscribed_users
(
recipients
,
target
)
recipients
.
delete
(
current_user
)
recipients
=
recipients
.
uniq
recipients
end
...
...
spec/services/notification_service_spec.rb
浏览文件 @
93096247
...
...
@@ -61,6 +61,7 @@ describe NotificationService, services: true do
should_email
(
note
.
noteable
.
assignee
)
should_email
(
@u_mentioned
)
should_email
(
@subscriber
)
should_email
(
@watcher_and_subscriber
)
should_email
(
@subscribed_participant
)
should_not_email
(
note
.
author
)
should_not_email
(
@u_participating
)
...
...
@@ -245,6 +246,7 @@ describe NotificationService, services: true do
should_email
(
@u_watcher
)
should_email
(
@u_participant_mentioned
)
should_email
(
@subscriber
)
should_email
(
@watcher_and_subscriber
)
should_not_email
(
@unsubscriber
)
should_not_email
(
@u_participating
)
should_not_email
(
@u_disabled
)
...
...
@@ -260,6 +262,7 @@ describe NotificationService, services: true do
should_email
(
@u_watcher
)
should_email
(
@u_participant_mentioned
)
should_email
(
@subscriber
)
should_email
(
@watcher_and_subscriber
)
should_not_email
(
@unsubscriber
)
should_not_email
(
@u_participating
)
end
...
...
@@ -282,6 +285,7 @@ describe NotificationService, services: true do
should_email
(
merge_request
.
assignee
)
should_email
(
@u_watcher
)
should_email
(
@watcher_and_subscriber
)
should_email
(
@u_participant_mentioned
)
should_not_email
(
@u_participating
)
should_not_email
(
@u_disabled
)
...
...
@@ -296,6 +300,7 @@ describe NotificationService, services: true do
should_email
(
@u_watcher
)
should_email
(
@u_participant_mentioned
)
should_email
(
@subscriber
)
should_email
(
@watcher_and_subscriber
)
should_not_email
(
@unsubscriber
)
should_not_email
(
@u_participating
)
should_not_email
(
@u_disabled
)
...
...
@@ -310,6 +315,7 @@ describe NotificationService, services: true do
should_email
(
@u_watcher
)
should_email
(
@u_participant_mentioned
)
should_email
(
@subscriber
)
should_email
(
@watcher_and_subscriber
)
should_not_email
(
@unsubscriber
)
should_not_email
(
@u_participating
)
should_not_email
(
@u_disabled
)
...
...
@@ -324,6 +330,7 @@ describe NotificationService, services: true do
should_email
(
@u_watcher
)
should_email
(
@u_participant_mentioned
)
should_email
(
@subscriber
)
should_email
(
@watcher_and_subscriber
)
should_not_email
(
@unsubscriber
)
should_not_email
(
@u_participating
)
should_not_email
(
@u_disabled
)
...
...
@@ -338,6 +345,7 @@ describe NotificationService, services: true do
should_email
(
@u_watcher
)
should_email
(
@u_participant_mentioned
)
should_email
(
@subscriber
)
should_email
(
@watcher_and_subscriber
)
should_not_email
(
@unsubscriber
)
should_not_email
(
@u_participating
)
should_not_email
(
@u_disabled
)
...
...
@@ -387,14 +395,18 @@ describe NotificationService, services: true do
@subscriber
=
create
:user
@unsubscriber
=
create
:user
@subscribed_participant
=
create
(
:user
,
username:
'subscribed_participant'
,
notification_level:
Notification
::
N_PARTICIPATING
)
@watcher_and_subscriber
=
create
(
:user
,
notification_level:
Notification
::
N_WATCH
)
project
.
team
<<
[
@subscribed_participant
,
:master
]
project
.
team
<<
[
@subscriber
,
:master
]
project
.
team
<<
[
@unsubscriber
,
:master
]
project
.
team
<<
[
@watcher_and_subscriber
,
:master
]
issuable
.
subscriptions
.
create
(
user:
@subscriber
,
subscribed:
true
)
issuable
.
subscriptions
.
create
(
user:
@subscribed_participant
,
subscribed:
true
)
issuable
.
subscriptions
.
create
(
user:
@unsubscriber
,
subscribed:
false
)
# Make the watcher a subscriber to detect dupes
issuable
.
subscriptions
.
create
(
user:
@watcher_and_subscriber
,
subscribed:
true
)
end
def
sent_to_user?
(
user
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录