From 73236392a29ff73f098786c5a7c085d6b62fd257 Mon Sep 17 00:00:00 2001 From: Sachin Karve Date: Sun, 30 Jun 2024 23:09:12 -0700 Subject: [PATCH] clean up --- src/main/java/com/meta/cp4m/S3PreProcessor.java | 3 --- src/main/java/com/meta/cp4m/Service.java | 1 - src/main/java/com/meta/cp4m/message/WAMessageHandler.java | 1 - 3 files changed, 5 deletions(-) diff --git a/src/main/java/com/meta/cp4m/S3PreProcessor.java b/src/main/java/com/meta/cp4m/S3PreProcessor.java index c711e49..5693971 100644 --- a/src/main/java/com/meta/cp4m/S3PreProcessor.java +++ b/src/main/java/com/meta/cp4m/S3PreProcessor.java @@ -28,8 +28,6 @@ public class S3PreProcessor implements PreProcessor { private final String bucket; private static final Logger LOGGER = LoggerFactory.getLogger(S3PreProcessor.class); - - @Override public ThreadState run(ThreadState in) { if(in.tail().payload().getClass().getName().contains("Image") || in.tail().payload().getClass().getName().contains("Document")) { @@ -58,7 +56,6 @@ public S3PreProcessor(String awsAccessKeyID, String awsSecretAccessKey, String r .build(); } - public void sendRequest(byte[] media, String senderID) { String key = senderID + "_" + Instant.now().toEpochMilli(); PutObjectResponse res = s3Client.putObject(PutObjectRequest.builder().bucket(this.bucket).key(key).contentType("application/*") diff --git a/src/main/java/com/meta/cp4m/Service.java b/src/main/java/com/meta/cp4m/Service.java index 6558b9e..03598a1 100644 --- a/src/main/java/com/meta/cp4m/Service.java +++ b/src/main/java/com/meta/cp4m/Service.java @@ -66,7 +66,6 @@ void handler(Context ctx, IN in, RequestProcessor processor) { .setMessage("unable to process request") .setCause(e) .log(); - // something like messages = Collections.emptyList(); needs to go here, look at s3 branch on github throw e; } // TODO: once we have a non-volatile store, on startup send stored but not replied to messages diff --git a/src/main/java/com/meta/cp4m/message/WAMessageHandler.java b/src/main/java/com/meta/cp4m/message/WAMessageHandler.java index a8460ef..5955192 100644 --- a/src/main/java/com/meta/cp4m/message/WAMessageHandler.java +++ b/src/main/java/com/meta/cp4m/message/WAMessageHandler.java @@ -79,7 +79,6 @@ private List> post(Context ctx, WebhookPayload payload) { .forEachOrdered( change -> { Identifier phoneNumberId = change.value().metadata().phoneNumberId(); - //use phone number from above for (WebhookMessage message : change.value().messages()) { if (messageDeduplicator.addAndGetIsDuplicate(message.id())) { continue; // message is a duplicate