mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Add chat_mention notification type (#13784)
This commit is contained in:
parent
76a11e6dc9
commit
80950d7b28
@ -75,7 +75,7 @@ class Notification < ActiveRecord::Base
|
|||||||
DB.exec(<<~SQL)
|
DB.exec(<<~SQL)
|
||||||
DELETE
|
DELETE
|
||||||
FROM notifications n
|
FROM notifications n
|
||||||
WHERE high_priority
|
WHERE high_priority AND notification_type <> #{types[:chat_mention].to_i}
|
||||||
AND NOT EXISTS (
|
AND NOT EXISTS (
|
||||||
SELECT 1
|
SELECT 1
|
||||||
FROM posts p
|
FROM posts p
|
||||||
@ -116,7 +116,8 @@ class Notification < ActiveRecord::Base
|
|||||||
reaction: 25,
|
reaction: 25,
|
||||||
votes_released: 26,
|
votes_released: 26,
|
||||||
event_reminder: 27,
|
event_reminder: 27,
|
||||||
event_invitation: 28
|
event_invitation: 28,
|
||||||
|
chat_mention: 29
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -341,6 +341,16 @@ describe Notification do
|
|||||||
|
|
||||||
expect(Notification.count).to eq(2)
|
expect(Notification.count).to eq(2)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'does not delete chat_message notifications' do
|
||||||
|
user = Fabricate(:user)
|
||||||
|
Notification.create!(read: false, user_id: user.id, topic_id: nil, post_number: nil, data: '[]',
|
||||||
|
notification_type: Notification.types[:chat_mention])
|
||||||
|
|
||||||
|
expect {
|
||||||
|
Notification.ensure_consistency!
|
||||||
|
}.to_not change { Notification.count }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '.filter_by_consolidation_data' do
|
describe '.filter_by_consolidation_data' do
|
||||||
|
Loading…
Reference in New Issue
Block a user