mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
FIX: don't notify on link reflections
This commit is contained in:
parent
b2e29526ff
commit
5d9eefbfed
2 changed files with 6 additions and 1 deletions
|
@ -144,7 +144,7 @@ class PostAlerter
|
|||
end
|
||||
|
||||
def extract_linked_users(post)
|
||||
post.topic_links.map do |link|
|
||||
post.topic_links.where(reflection: false).map do |link|
|
||||
linked_post = link.link_post
|
||||
if !linked_post && topic = link.link_topic
|
||||
linked_post = topic.posts(post_number: 1).first
|
||||
|
|
|
@ -44,6 +44,11 @@ describe PostAlerter do
|
|||
|
||||
user.reload
|
||||
user.notifications.count.should == 1
|
||||
|
||||
# don't notify on reflection
|
||||
post1.reload
|
||||
PostAlerter.new.extract_linked_users(post1).length.should == 0
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue