From 136e9e53d2fbeeb619ec524bcef6ea4276df005a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20Caballero?= Date: Sun, 28 Feb 2021 20:16:36 +0100 Subject: [PATCH] fix: emjois being url-encoded when replying to stories --- .../directmessages/StoryReplyBroadcastOptions.java | 2 +- .../java/awais/instagrabber/utils/TextUtils.java | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/app/src/main/java/awais/instagrabber/repositories/requests/directmessages/StoryReplyBroadcastOptions.java b/app/src/main/java/awais/instagrabber/repositories/requests/directmessages/StoryReplyBroadcastOptions.java index 3ab57d14..7fe3f8d0 100644 --- a/app/src/main/java/awais/instagrabber/repositories/requests/directmessages/StoryReplyBroadcastOptions.java +++ b/app/src/main/java/awais/instagrabber/repositories/requests/directmessages/StoryReplyBroadcastOptions.java @@ -17,7 +17,7 @@ public class StoryReplyBroadcastOptions extends BroadcastOptions { final String reelId) throws UnsupportedEncodingException { super(clientContext, threadIdOrUserIds, BroadcastItemType.REELSHARE); - this.text = TextUtils.encode(text); + this.text = text; this.mediaId = mediaId; this.reelId = reelId; // or user id, usually same } diff --git a/app/src/main/java/awais/instagrabber/utils/TextUtils.java b/app/src/main/java/awais/instagrabber/utils/TextUtils.java index 95e82599..e26bd8cf 100644 --- a/app/src/main/java/awais/instagrabber/utils/TextUtils.java +++ b/app/src/main/java/awais/instagrabber/utils/TextUtils.java @@ -104,18 +104,6 @@ public final class TextUtils { return (int) ((d2 - d1) / DateUtils.DAY_IN_MILLIS); } - @NonNull - public static String encode(final String text) throws UnsupportedEncodingException { - return URLEncoder.encode(text, "UTF-8") - .replaceAll("\\+", "%20") - .replaceAll("%21", "!") - .replaceAll("%27", "'") - .replaceAll("%28", "(") - .replaceAll("%29", ")") - .replaceAll("%7E", "~") - .replaceAll("%0A", "\n"); - } - public static List extractUrls(final String text) { if (isEmpty(text)) return Collections.emptyList(); final Matcher matcher = Patterns.WEB_URL.matcher(text);