From 1fa8a9e8585ff4c772618a6d5510e8b214c415bf Mon Sep 17 00:00:00 2001 From: Grishka Date: Wed, 26 Oct 2022 18:28:57 +0300 Subject: [PATCH] Always show domain for own account --- .../android/fragments/ProfileFragment.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java index 724396c6..b3f4d9fe 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java @@ -415,9 +415,16 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList HtmlParser.parseCustomEmoji(ssb, account.emojis); name.setText(ssb); setTitle(ssb); + + boolean isSelf=AccountSessionManager.getInstance().isSelf(accountID, account); + if(account.locked){ ssb=new SpannableStringBuilder("@"); ssb.append(account.acct); + if(isSelf){ + ssb.append('@'); + ssb.append(AccountSessionManager.getInstance().getAccount(accountID).domain); + } ssb.append(" "); Drawable lock=username.getResources().getDrawable(R.drawable.ic_fluent_lock_closed_20_filled, getActivity().getTheme()).mutate(); lock.setBounds(0, 0, lock.getIntrinsicWidth(), lock.getIntrinsicHeight()); @@ -425,7 +432,8 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList ssb.append(getString(R.string.manually_approves_followers), new ImageSpan(lock, ImageSpan.ALIGN_BOTTOM), 0); username.setText(ssb); }else{ - username.setText('@'+account.acct); + // noinspection SetTextI18n + username.setText('@'+account.acct+(isSelf ? ('@'+AccountSessionManager.getInstance().getAccount(accountID).domain) : "")); } CharSequence parsedBio=HtmlParser.parse(account.note, account.emojis, Collections.emptyList(), Collections.emptyList(), accountID); if(TextUtils.isEmpty(parsedBio)){