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

This commit is contained in:
Matt Jankowski authored and GitHub committed 2024-06-10 15:23:55 +00:00
1 parent 9bf2e2eda0
commit 9cc4040308
2 files changed
+10 -6

No files matched your search

+3 -1
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