From dce5a8d89c2a5ef6a38fb482c0cb83e1df37e346 Mon Sep 17 00:00:00 2001 From: Balazs Toldi Date: Tue, 15 Aug 2023 08:23:14 +0200 Subject: [PATCH] Fix resolving communities from non-home instance URLs --- .../main/java/eu/toldi/infinityforlemmy/utils/LemmyUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/eu/toldi/infinityforlemmy/utils/LemmyUtils.java b/app/src/main/java/eu/toldi/infinityforlemmy/utils/LemmyUtils.java index e07c908e..d67cf6d1 100644 --- a/app/src/main/java/eu/toldi/infinityforlemmy/utils/LemmyUtils.java +++ b/app/src/main/java/eu/toldi/infinityforlemmy/utils/LemmyUtils.java @@ -5,7 +5,7 @@ public class LemmyUtils { String[] splitURL = url.split("/"); String userName = splitURL[splitURL.length - 1]; String domain = splitURL[2]; - return userName + "@" + domain; + return (userName.contains("@")) ? userName : userName + "@" + domain; } public static String qualifiedCommunityName2ActorId(String qualifiedName) {