Skip to content

Commit

Permalink
Merge pull request #806 from kmycode/kb-draft-5.23-lts
Browse files Browse the repository at this point in the history
Release: 5.23 LTS
  • Loading branch information
kmycode authored Aug 19, 2024
2 parents a2d3de4 + 836c02d commit 4e94e72
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 7 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion app/services/notify_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def response_to_recipient?

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?
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/mastodon/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def kmyblue_major
end

def kmyblue_minor
22
23
end

def kmyblue_flag
Expand All @@ -25,7 +25,7 @@ def minor
end

def patch
11
12
end

def default_prerelease
Expand Down
11 changes: 11 additions & 0 deletions spec/services/notify_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@
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)
Expand Down

0 comments on commit 4e94e72

Please sign in to comment.