diff --git a/app/src/main/java/app/fedilab/android/mastodon/activities/ProfileActivity.java b/app/src/main/java/app/fedilab/android/mastodon/activities/ProfileActivity.java index 02eb56c53..ccb980f65 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/activities/ProfileActivity.java +++ b/app/src/main/java/app/fedilab/android/mastodon/activities/ProfileActivity.java @@ -625,18 +625,18 @@ public class ProfileActivity extends BaseActivity { binding.accountFollow.setContentDescription(getString(R.string.action_disabled)); } - if (relationship.requested) { - binding.accountFollowRequest.setVisibility(View.VISIBLE); - binding.accountFollow.setIconResource(R.drawable.ic_baseline_hourglass_full_24); - binding.accountFollow.setVisibility(View.VISIBLE); - binding.accountFollow.setContentDescription(getString(R.string.follow_request)); - doAction = action.UNFOLLOW; - } + if (relationship.followed_by) { binding.accountFollowedBy.setVisibility(View.VISIBLE); } else { binding.accountFollowedBy.setVisibility(View.GONE); } + if (relationship.requested_by) { + binding.accountRequestedBy.setVisibility(View.VISIBLE); + } else { + binding.accountRequestedBy.setVisibility(View.GONE); + } + binding.accountFollowRequest.setVisibility(View.GONE); if (relationship.following) { binding.accountFollow.setIconResource(R.drawable.ic_baseline_person_remove_24); binding.accountFollow.setBackgroundTintList(ColorStateList.valueOf(ThemeHelper.getAttColor(this, R.attr.colorError))); @@ -649,12 +649,20 @@ public class ProfileActivity extends BaseActivity { doAction = action.UNBLOCK; binding.accountFollow.setVisibility(View.VISIBLE); binding.accountFollow.setContentDescription(getString(R.string.action_unblock)); + } else if (relationship.requested) { + binding.accountFollowRequest.setVisibility(View.VISIBLE); + binding.accountFollow.setIconResource(R.drawable.ic_baseline_hourglass_full_24); + binding.accountFollow.setVisibility(View.VISIBLE); + binding.accountFollow.setContentDescription(getString(R.string.follow_request)); + doAction = action.UNFOLLOW; } else { binding.accountFollow.setIconResource(R.drawable.ic_baseline_person_add_24); doAction = action.FOLLOW; binding.accountFollow.setVisibility(View.VISIBLE); binding.accountFollow.setContentDescription(getString(R.string.action_follow)); } + + //The value for account is from same server so id can be used if (account.id.equals(currentAccount.user_id)) { diff --git a/app/src/main/java/app/fedilab/android/mastodon/client/entities/api/RelationShip.java b/app/src/main/java/app/fedilab/android/mastodon/client/entities/api/RelationShip.java index 035b57d9c..98065fc38 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/client/entities/api/RelationShip.java +++ b/app/src/main/java/app/fedilab/android/mastodon/client/entities/api/RelationShip.java @@ -32,6 +32,9 @@ public class RelationShip { public boolean followed_by; @SerializedName("blocking") public boolean blocking; + + @SerializedName("requested_by") + public boolean requested_by; @SerializedName("blocked_by") public boolean blocked_by; @SerializedName("muting") diff --git a/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/AccountAdapter.java b/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/AccountAdapter.java index 023490f1a..27107b8c3 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/AccountAdapter.java +++ b/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/AccountAdapter.java @@ -148,6 +148,11 @@ public class AccountAdapter extends RecyclerView.Adapter + + + + Unmute Request sent Follows you + Requested to follow you First letter in capital for replies Resize pictures Resize videos diff --git a/src/fdroid/fastlane/metadata/android/en/changelogs/484.txt b/src/fdroid/fastlane/metadata/android/en/changelogs/484.txt index f28fa2182..3511a7370 100644 --- a/src/fdroid/fastlane/metadata/android/en/changelogs/484.txt +++ b/src/fdroid/fastlane/metadata/android/en/changelogs/484.txt @@ -1,9 +1,11 @@ Added: - Add a button to fetch remote media when it fails - Add a settings to automatically fetch remote media when it fails (default: disabled) +- Display on profiles & list of accounts if users have requested to follow you Changed: - Warn when there are missing descriptions enabled by default Fixed: -- Some settings not properly restored (multiple choices) \ No newline at end of file +- Some settings not properly restored (multiple choices) +- Cancel a follow request \ No newline at end of file