From 9d690e7670a82d4c1f5de19a030e23d3dd8125ad Mon Sep 17 00:00:00 2001 From: FineFindus Date: Sun, 16 Apr 2023 21:07:22 +0200 Subject: [PATCH] fix: own instance accounts not loading --- .../account_list/PaginatedAccountListFragment.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/account_list/PaginatedAccountListFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/account_list/PaginatedAccountListFragment.java index a3bb0586d..97da06083 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/account_list/PaginatedAccountListFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/account_list/PaginatedAccountListFragment.java @@ -1,5 +1,7 @@ package org.joinmastodon.android.fragments.account_list; +import android.net.Uri; + import org.joinmastodon.android.GlobalUserPreferences; import org.joinmastodon.android.api.requests.HeaderPaginationRequest; import org.joinmastodon.android.model.Account; @@ -24,7 +26,7 @@ public abstract class PaginatedAccountListFragment extends BaseAccountListFragme if(GlobalUserPreferences.loadRemoteAccountFollowers){ if ((this instanceof FollowingListFragment || this instanceof FollowerListFragment) && targetAccount != null){ UiUtils.lookupRemoteAccount(getContext(), targetAccount, accountID, null, account -> { - if(account != null){ + if(account != null && account.getDomain() != null){ currentRequest=onCreateRemoteRequest(account.id, offset==0 ? null : nextMaxID, count) .setCallback(new SimpleCallback<>(this){ @Override @@ -35,6 +37,9 @@ public abstract class PaginatedAccountListFragment extends BaseAccountListFragme nextMaxID=null; result.stream().forEach(remoteAccount -> { remoteAccount.reloadWhenClicked = true; + if (remoteAccount.getDomain() == null) { + remoteAccount.acct += "@" + Uri.parse(remoteAccount.url).getHost(); + } }); if (getActivity() == null) return; onDataLoaded(result.stream().map(AccountItem::new).collect(Collectors.toList()), false);