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 cd5f93974a..3a382f4ef6 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 @@ -14,6 +14,7 @@ import java.util.Collection; import java.util.Collections; import java.util.List; +import java.util.Objects; import java.util.stream.Collectors; import me.grishka.appkit.api.Callback; @@ -136,6 +137,10 @@ public void onSuccess(HeaderPaginationList result){ List items = result.stream() .filter(a -> d.size() > 1000 || d.stream() .noneMatch(i -> i.account.url.equals(a.url))) + .peek(account ->{ + if (account.getDomainFromURL().equals(getRemoteDomain())) + account.acct=account.getFullyQualifiedName(); + }) .map(a->new AccountViewModel(a, accountID)) .collect(Collectors.toList()); diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/settings/SettingsServerAboutFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/settings/SettingsServerAboutFragment.java index 66809514e0..7f588b9911 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/settings/SettingsServerAboutFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/settings/SettingsServerAboutFragment.java @@ -8,6 +8,7 @@ import android.os.Build; import android.os.Bundle; import android.text.TextUtils; +import android.util.Log; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; @@ -24,6 +25,7 @@ import org.joinmastodon.android.R; import org.joinmastodon.android.api.MastodonAPIController; import org.joinmastodon.android.api.requests.instance.GetInstanceExtendedDescription; +import org.joinmastodon.android.api.session.AccountSessionManager; import org.joinmastodon.android.model.Instance; import org.joinmastodon.android.model.viewmodel.AccountViewModel; import org.joinmastodon.android.model.viewmodel.ListItem; @@ -126,6 +128,8 @@ public boolean shouldOverrideUrlLoading(WebView view, String url){ hlp.leftMargin=hlp.rightMargin=V.dp(16); scrollingLayout.addView(heading, hlp); + // if a remote instance is shown, the account is remote and need to be loaded accordingly when shown + instance.contactAccount.isRemote=!AccountSessionManager.get(accountID).domain.equals(instance.normalizedUri); AccountViewModel model=new AccountViewModel(instance.contactAccount, accountID); AccountViewHolder holder=new AccountViewHolder(this, scrollingLayout, null); holder.setStyle(AccountViewHolder.AccessoryType.NONE, false); diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/viewholders/AccountViewHolder.java b/mastodon/src/main/java/org/joinmastodon/android/ui/viewholders/AccountViewHolder.java index 0e25d43d5b..e218ddff4e 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/viewholders/AccountViewHolder.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/viewholders/AccountViewHolder.java @@ -190,7 +190,10 @@ public void onClick(){ } Bundle args=new Bundle(); args.putString("account", accountID); - args.putParcelable("profileAccount", Parcels.wrap(item.account)); + if (item.account.isRemote) + args.putParcelable("remoteAccount", Parcels.wrap(item.account)); + else + args.putParcelable("profileAccount", Parcels.wrap(item.account)); Nav.go(fragment.getActivity(), ProfileFragment.class, args); }