0
0
Fork 0

Extract COMMENT_SIZE_LIMIT constant in AP::Activity::Flag class (#30637)

This commit is contained in:
Matt Jankowski 2024-06-10 11:23:55 -04:00 committed by GitHub
parent 9bf2e2eda0
commit 9cc4040308
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 6 deletions

View file

@ -1,6 +1,8 @@
# frozen_string_literal: true
class ActivityPub::Activity::Flag < ActivityPub::Activity
COMMENT_SIZE_LIMIT = 5000
def perform
return if skip_reports?
@ -38,6 +40,6 @@ class ActivityPub::Activity::Flag < ActivityPub::Activity
end
def report_comment
(@json['content'] || '')[0...5000]
(@json['content'] || '')[0...COMMENT_SIZE_LIMIT]
end
end