File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
app/lib/activitypub/activity Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -85,8 +85,16 @@ def process_status
8585 ApplicationRecord . transaction do
8686 @status = Status . create! ( @params )
8787 attach_tags ( @status )
88+
89+ # Delete status on zero follower user and nearly created account with include some replies
90+ if like_a_spam?
91+ @status = nil
92+ raise ActiveRecord ::Rollback
93+ end
8894 end
8995
96+ return if @status . nil?
97+
9098 resolve_thread ( @status )
9199 fetch_replies ( @status )
92100 distribute
@@ -426,4 +434,13 @@ def increment_voters_count!
426434 poll . reload
427435 retry
428436 end
437+
438+ def like_a_spam?
439+ (
440+ !@status . account . local? &&
441+ @status . account . followers_count . zero? &&
442+ @status . account . created_at > 1 . day . ago &&
443+ @mentions . count >= 2
444+ )
445+ end
429446end
You can’t perform that action at this time.
0 commit comments