Merge commit 'f9a929ed5c' into kb-draft-5.23-lts

This commit is contained in:
KMY 2024-08-19 18:42:48 +09:00
commit 8bc6f3c73c
5 changed files with 23 additions and 6 deletions

View file

@ -2,7 +2,13 @@
All notable changes to this project will be documented in this file.
## |4.2.11] - 2024-08-16
## [4.2.12] - 2024-08-19
### Fixed
- Fix broken notifications for mentions from local moderators ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/31484))
## [4.2.11] - 2024-08-16
### Added

View file

@ -89,7 +89,7 @@ class NotifyService < BaseService
def from_staff?
sender = @notification.from_account
sender.local? && sender.user.present? && sender.user_role&.overrides?(@recipient.user_role) && @sender.user_role&.highlighted? && sender.user_role&.can?(*UserRole::Flags::CATEGORIES[:moderation])
sender.local? && sender.user.present? && sender.user_role&.overrides?(@recipient.user_role) && sender.user_role&.highlighted? && sender.user_role&.can?(*UserRole::Flags::CATEGORIES[:moderation].map(&:to_sym))
end
def optional_non_following_and_direct?

View file

@ -56,7 +56,7 @@ services:
web:
build: .
image: ghcr.io/mastodon/mastodon:v4.2.11
image: ghcr.io/mastodon/mastodon:v4.2.12
restart: always
env_file: .env.production
command: bash -c "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p 3000"
@ -77,7 +77,7 @@ services:
streaming:
build: .
image: ghcr.io/mastodon/mastodon:v4.2.11
image: ghcr.io/mastodon/mastodon:v4.2.12
restart: always
env_file: .env.production
command: node ./streaming
@ -95,7 +95,7 @@ services:
sidekiq:
build: .
image: ghcr.io/mastodon/mastodon:v4.2.11
image: ghcr.io/mastodon/mastodon:v4.2.12
restart: always
env_file: .env.production
command: bundle exec sidekiq

View file

@ -25,7 +25,7 @@ module Mastodon
end
def patch
11
12
end
def default_prerelease

View file

@ -18,6 +18,17 @@ RSpec.describe NotifyService, type: :service do
expect { subject }.to_not change(Notification, :count)
end
context 'when the sender is a local moderator' do
let(:sender) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')).account }
let(:type) { :mention }
let(:activity) { Fabricate(:mention, account: recipient, status: Fabricate(:status, account: sender)) }
it 'does notify when the sender is blocked' do
recipient.block!(sender)
expect { subject }.to change(Notification, :count).by(1)
end
end
it 'does not notify when sender is muted with hide_notifications' do
recipient.mute!(sender, notifications: true)
expect { subject }.to_not change(Notification, :count)