From fc70129c969ca525550c4247d6c49f87db3639b8 Mon Sep 17 00:00:00 2001 From: Austin Huang Date: Sat, 15 May 2021 12:53:00 -0400 Subject: [PATCH] close #1040 (probably) --- .../instagrabber/fragments/main/ProfileFragment.java | 4 ++-- .../instagrabber/repositories/responses/User.java | 12 ++++++++++-- .../instagrabber/webservices/GraphQLService.java | 1 + 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/awais/instagrabber/fragments/main/ProfileFragment.java b/app/src/main/java/awais/instagrabber/fragments/main/ProfileFragment.java index da752a26..cc646855 100644 --- a/app/src/main/java/awais/instagrabber/fragments/main/ProfileFragment.java +++ b/app/src/main/java/awais/instagrabber/fragments/main/ProfileFragment.java @@ -407,7 +407,7 @@ public class ProfileFragment extends Fragment implements SwipeRefreshLayout.OnRe } chainingMenuItem = menu.findItem(R.id.chaining); if (chainingMenuItem != null) { - chainingMenuItem.setVisible(isNotMe); + chainingMenuItem.setVisible(isNotMe && profileModel.hasChaining()); } } @@ -976,7 +976,7 @@ public class ProfileFragment extends Fragment implements SwipeRefreshLayout.OnRe mutePostsMenuItem.setTitle(profileModel.getFriendshipStatus().isMuting() ? R.string.unmute_posts : R.string.mute_posts); } if (chainingMenuItem != null) { - chainingMenuItem.setVisible(true); + chainingMenuItem.setVisible(profileModel.hasChaining()); } } } diff --git a/app/src/main/java/awais/instagrabber/repositories/responses/User.java b/app/src/main/java/awais/instagrabber/repositories/responses/User.java index 716735e3..0d707f72 100644 --- a/app/src/main/java/awais/instagrabber/repositories/responses/User.java +++ b/app/src/main/java/awais/instagrabber/repositories/responses/User.java @@ -17,6 +17,7 @@ public class User implements Serializable { private final boolean isUnpublished; private final boolean isFavorite; private final boolean isDirectappInstalled; + private final boolean hasChaining; private final String reelAutoArchive; private final String allowedCommenterType; private final long mediaCount; @@ -45,6 +46,7 @@ public class User implements Serializable { final boolean isUnpublished, final boolean isFavorite, final boolean isDirectappInstalled, + final boolean hasChaining, final String reelAutoArchive, final String allowedCommenterType, final long mediaCount, @@ -72,6 +74,7 @@ public class User implements Serializable { this.isUnpublished = isUnpublished; this.isFavorite = isFavorite; this.isDirectappInstalled = isDirectappInstalled; + this.hasChaining = hasChaining; this.reelAutoArchive = reelAutoArchive; this.allowedCommenterType = allowedCommenterType; this.mediaCount = mediaCount; @@ -118,6 +121,7 @@ public class User implements Serializable { this.isUnpublished = false; this.isFavorite = false; this.isDirectappInstalled = false; + this.hasChaining = false; this.reelAutoArchive = null; this.allowedCommenterType = null; this.mediaCount = 0; @@ -194,6 +198,10 @@ public class User implements Serializable { return isDirectappInstalled; } + public boolean hasChaining() { + return hasChaining; + } + public String getReelAutoArchive() { return reelAutoArchive; } @@ -282,7 +290,7 @@ public class User implements Serializable { @Override public int hashCode() { return Objects.hash(pk, username, fullName, isPrivate, profilePicUrl, profilePicId, friendshipStatus, isVerified, hasAnonymousProfilePicture, - isUnpublished, isFavorite, isDirectappInstalled, reelAutoArchive, allowedCommenterType, mediaCount, followerCount, - followingCount, followingTagCount, biography, externalUrl, usertagsCount, publicEmail); + isUnpublished, isFavorite, isDirectappInstalled, hasChaining, reelAutoArchive, allowedCommenterType, mediaCount, + followerCount, followingCount, followingTagCount, biography, externalUrl, usertagsCount, publicEmail); } } diff --git a/app/src/main/java/awais/instagrabber/webservices/GraphQLService.java b/app/src/main/java/awais/instagrabber/webservices/GraphQLService.java index 20cf6918..ddb6da6b 100644 --- a/app/src/main/java/awais/instagrabber/webservices/GraphQLService.java +++ b/app/src/main/java/awais/instagrabber/webservices/GraphQLService.java @@ -324,6 +324,7 @@ public class GraphQLService extends BaseService { false, false, false, + false, null, null, timelineMedia.getLong("count"),