From 7975fcdb8d704a244f1f405253da4ad3fd9dac36 Mon Sep 17 00:00:00 2001 From: Huseyin Gumus <98863443+erhaneth@users.noreply.github.com> Date: Fri, 31 Mar 2023 19:29:06 -0700 Subject: [PATCH] add support for "Spamming" reason This PR adds the 'Spamming' reason to our code. It helps the system detect and zap spammy posts. Made updates to the code to handle this new reason. --- .../src/main/scala/com/twitter/visibility/rules/Action.scala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/visibilitylib/src/main/scala/com/twitter/visibility/rules/Action.scala b/visibilitylib/src/main/scala/com/twitter/visibility/rules/Action.scala index 47446832a..9dc69a8d1 100644 --- a/visibilitylib/src/main/scala/com/twitter/visibility/rules/Action.scala +++ b/visibilitylib/src/main/scala/com/twitter/visibility/rules/Action.scala @@ -130,6 +130,7 @@ object Reason { case object LocalLawsWithheld extends Reason case object HatefulConduct extends Reason case object AbusiveBehavior extends Reason + case object Spamming extends Reason // Add a new case object for "Spamming" case object NotSupportedOnDevice extends Reason @@ -190,6 +191,7 @@ object Reason { reason match { case HatefulConduct => Some(AppealableReason.HatefulConduct(violationLevel.level)) case AbusiveBehavior => Some(AppealableReason.AbusiveBehavior(violationLevel.level)) + case Spamming => Some(AppealableReason.Spamming(violationLevel.level)) // New case for handling Spamming case _ => Some(AppealableReason.Unspecified(violationLevel.level)) }