From 386b6db5ff93ef9389468e1152e66278e0b762e3 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Fri, 29 Sep 2023 16:23:42 -0400 Subject: [PATCH] Fixes relay type loading from the default list when they are not present in the user's account yet. --- .../main/java/com/vitorpamplona/amethyst/model/Account.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/model/Account.kt b/app/src/main/java/com/vitorpamplona/amethyst/model/Account.kt index 0c4363cf7..664418268 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/model/Account.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/model/Account.kt @@ -2955,7 +2955,10 @@ class Account( // Takes a User's relay list and adds the types of feeds they are active for. fun activeRelays(): Array? { var usersRelayList = userProfile().latestContactList?.relays()?.map { - val localFeedTypes = localRelays.firstOrNull() { localRelay -> localRelay.url == it.key }?.feedTypes ?: FeedType.values().toSet() + val localFeedTypes = localRelays.firstOrNull() { localRelay -> localRelay.url == it.key }?.feedTypes + ?: Constants.defaultRelays.filter { defaultRelay -> defaultRelay.url == it.key }.firstOrNull()?.feedTypes + ?: FeedType.values().toSet() + Relay(it.key, it.value.read, it.value.write, localFeedTypes, proxy) } ?: return null