From d675803f0768eb7479226acd370147c7e3c7f4a3 Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 19 Aug 2024 09:52:32 +0200 Subject: [PATCH 1/3] Fix broken notifications for mentions from local moderators in 4.2.11 (#31484) --- app/services/notify_service.rb | 2 +- spec/services/notify_service_spec.rb | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/services/notify_service.rb b/app/services/notify_service.rb index 2001fa6dac..515248979a 100644 --- a/app/services/notify_service.rb +++ b/app/services/notify_service.rb @@ -87,7 +87,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? diff --git a/spec/services/notify_service_spec.rb b/spec/services/notify_service_spec.rb index c2664e79c2..568fb1cdfd 100644 --- a/spec/services/notify_service_spec.rb +++ b/spec/services/notify_service_spec.rb @@ -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) From f9a929ed5c71e0aaf42c124e96d499d81507c2ac Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 19 Aug 2024 11:13:45 +0200 Subject: [PATCH 2/3] Bump version to v4.2.12 (#31491) --- CHANGELOG.md | 8 +++++++- docker-compose.yml | 6 +++--- lib/mastodon/version.rb | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b0c05d0d3a..b2229f9fdc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/docker-compose.yml b/docker-compose.yml index a599f01e6e..d4d5e89feb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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 diff --git a/lib/mastodon/version.rb b/lib/mastodon/version.rb index 52e1ea540d..f0e0554c3f 100644 --- a/lib/mastodon/version.rb +++ b/lib/mastodon/version.rb @@ -13,7 +13,7 @@ module Mastodon end def patch - 11 + 12 end def default_prerelease From 836c02d8163f1b0f2662bb5fa0500b2be0ae1556 Mon Sep 17 00:00:00 2001 From: KMY Date: Mon, 19 Aug 2024 18:45:19 +0900 Subject: [PATCH 3/3] Bump version to 5.23 LTS --- lib/mastodon/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mastodon/version.rb b/lib/mastodon/version.rb index 63d651249e..92b18006f5 100644 --- a/lib/mastodon/version.rb +++ b/lib/mastodon/version.rb @@ -9,7 +9,7 @@ module Mastodon end def kmyblue_minor - 22 + 23 end def kmyblue_flag