From 888cec3d56328d723928c498a2875162a33fd7a8 Mon Sep 17 00:00:00 2001 From: Jon Chambers Date: Fri, 12 Nov 2021 13:21:52 -0500 Subject: [PATCH] Introduce a filter for correcting numeric "online" flags --- .../textsecuregcm/WhisperServerService.java | 7 ++ .../AcceptNumericOnlineFlagRequestFilter.java | 32 +++++++++ ...eptNumericOnlineFlagRequestFilterTest.java | 66 +++++++++++++++++++ 3 files changed, 105 insertions(+) create mode 100644 service/src/main/java/org/whispersystems/textsecuregcm/controllers/AcceptNumericOnlineFlagRequestFilter.java create mode 100644 service/src/test/java/org/whispersystems/textsecuregcm/controllers/AcceptNumericOnlineFlagRequestFilterTest.java diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerService.java b/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerService.java index 54fa87548..626aa1702 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerService.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerService.java @@ -79,6 +79,7 @@ import org.whispersystems.textsecuregcm.badges.ConfiguredProfileBadgeConverter; import org.whispersystems.textsecuregcm.badges.ResourceBundleLevelTranslator; import org.whispersystems.textsecuregcm.configuration.DirectoryServerConfiguration; import org.whispersystems.textsecuregcm.configuration.dynamic.DynamicConfiguration; +import org.whispersystems.textsecuregcm.controllers.AcceptNumericOnlineFlagRequestFilter; import org.whispersystems.textsecuregcm.controllers.AccountController; import org.whispersystems.textsecuregcm.controllers.AttachmentControllerV1; import org.whispersystems.textsecuregcm.controllers.AttachmentControllerV2; @@ -610,7 +611,12 @@ public class WhisperServerService extends Application