mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-22 18:45:41 +01:00
Change notification requests to only count mentions (#31322)
This commit is contained in:
parent
fc964c9bfd
commit
af2aec1a82
3 changed files with 3 additions and 3 deletions
|
@ -47,6 +47,6 @@ class NotificationRequest < ApplicationRecord
|
||||||
private
|
private
|
||||||
|
|
||||||
def prepare_notifications_count
|
def prepare_notifications_count
|
||||||
self.notifications_count = Notification.where(account: account, from_account: from_account, filtered: true).limit(MAX_MEANINGFUL_COUNT).count
|
self.notifications_count = Notification.where(account: account, from_account: from_account, type: :mention, filtered: true).limit(MAX_MEANINGFUL_COUNT).count
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,7 +9,7 @@ RSpec.describe NotificationPolicy do
|
||||||
let(:sender) { Fabricate(:account) }
|
let(:sender) { Fabricate(:account) }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
Fabricate.times(2, :notification, account: subject.account, activity: Fabricate(:status, account: sender), filtered: true)
|
Fabricate.times(2, :notification, account: subject.account, activity: Fabricate(:status, account: sender), filtered: true, type: :mention)
|
||||||
Fabricate(:notification_request, account: subject.account, from_account: sender)
|
Fabricate(:notification_request, account: subject.account, from_account: sender)
|
||||||
subject.summarize!
|
subject.summarize!
|
||||||
end
|
end
|
||||||
|
|
|
@ -8,7 +8,7 @@ RSpec.describe NotificationRequest do
|
||||||
|
|
||||||
context 'when there are remaining notifications' do
|
context 'when there are remaining notifications' do
|
||||||
before do
|
before do
|
||||||
Fabricate(:notification, account: subject.account, activity: Fabricate(:status, account: subject.from_account), filtered: true)
|
Fabricate(:notification, account: subject.account, activity: Fabricate(:status, account: subject.from_account), filtered: true, type: :mention)
|
||||||
subject.reconsider_existence!
|
subject.reconsider_existence!
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue