mirror of
https://github.com/discourse/discourse.git
synced 2025-02-21 03:19:10 +00:00
Merge pull request #2056 from vikhyat/pm-likes
Don't suppress like notifications in private messages
This commit is contained in:
commit
11d91328ab
@ -37,7 +37,6 @@ class PostAlertObserver < ActiveRecord::Observer
|
||||
|
||||
post = post_action.post
|
||||
return if post_action.user.blank?
|
||||
return if post.topic.private_message?
|
||||
|
||||
create_notification(post.user,
|
||||
Notification.types[:liked],
|
||||
|
@ -96,7 +96,11 @@ describe PostAlertObserver do
|
||||
context 'private message' do
|
||||
let(:user) { Fabricate(:user) }
|
||||
let(:mention_post) { Fabricate(:post, user: user, raw: 'Hello @eviltrout')}
|
||||
let(:topic) { mention_post.topic }
|
||||
let(:topic) do
|
||||
topic = mention_post.topic
|
||||
topic.update_column :archetype, Archetype.private_message
|
||||
topic
|
||||
end
|
||||
|
||||
it "won't notify someone who can't see the post" do
|
||||
lambda {
|
||||
@ -104,6 +108,14 @@ describe PostAlertObserver do
|
||||
mention_post
|
||||
}.should_not change(evil_trout.notifications, :count)
|
||||
end
|
||||
|
||||
it 'creates like notifications' do
|
||||
other_user = Fabricate(:user)
|
||||
topic.allowed_users << user << other_user
|
||||
lambda {
|
||||
PostAction.act(other_user, mention_post, PostActionType.types[:like])
|
||||
}.should change(user.notifications, :count)
|
||||
end
|
||||
end
|
||||
|
||||
context 'moderator action post' do
|
||||
|
Loading…
x
Reference in New Issue
Block a user