Fix moderator account being exposed in account moderation notification (#30082)

This commit is contained in:
Claire authored and GitHub committed 2024-04-26 12:42:06 +00:00
1 parent 5201882a23
commit e845594878
2 files changed
+13 -2

No files matched your search

+2 -2
View File
@@ -184,13 +184,13 @@ class Notification < ApplicationRecord
return unless new_record?
case activity_type
when 'Status', 'Follow', 'Favourite', 'FollowRequest', 'Poll', 'Report', 'AccountWarning'
when 'Status', 'Follow', 'Favourite', 'FollowRequest', 'Poll', 'Report'
self.from_account_id = activity&.account_id
when 'Mention'
self.from_account_id = activity&.status&.account_id
when 'Account'
self.from_account_id = activity&.id
when 'AccountRelationshipSeveranceEvent'
when 'AccountRelationshipSeveranceEvent', 'AccountWarning'
# These do not really have an originating account, but this is mandatory
# in the data model, and the recipient's account will by definition
# always exist