mirror of
https://github.com/discourse/discourse.git
synced 2025-01-31 04:29:29 +08:00
remove old buggy code see: http://meta.discourse.org/t/quoted-you-emails/2226/3
notify by display name is silly, display name is not unique in the system
This commit is contained in:
parent
99526c33da
commit
925925817f
|
@ -101,7 +101,7 @@ class PostAlertObserver < ActiveRecord::Observer
|
|||
result = []
|
||||
post.raw.scan(/\[quote=\"([^,]+),.+\"\]/).uniq.each do |m|
|
||||
username = m.first.strip.downcase
|
||||
user = User.where("(LOWER(username_lower) = :username or LOWER(name) = :username) and id != :id", username: username, id: post.user_id).first
|
||||
user = User.where("username_lower = :username and id != :id", username: username, id: post.user_id).first
|
||||
result << user if user.present?
|
||||
end
|
||||
result
|
||||
|
|
|
@ -37,11 +37,6 @@ describe PostAlertObserver do
|
|||
|
||||
|
||||
context 'quotes' do
|
||||
it 'notifies a user by display username' do
|
||||
lambda {
|
||||
Fabricate(:post, raw: '[quote="Evil Trout, post:1"]whatup[/quote]')
|
||||
}.should change(evil_trout.notifications, :count).by(1)
|
||||
end
|
||||
|
||||
it 'notifies a user by username' do
|
||||
lambda {
|
||||
|
|
Loading…
Reference in New Issue
Block a user