1
0
mirror of https://github.com/KokaKiwi/BarInsta synced 2024-11-08 07:57:28 +00:00

add a simple user constructor

This commit is contained in:
Austin Huang 2021-05-15 12:52:31 -04:00
parent 37edc0171e
commit f89f0ef542
No known key found for this signature in database
GPG Key ID: 84C23AA04587A91F
6 changed files with 57 additions and 121 deletions

View File

@ -28,11 +28,10 @@ public class User implements Serializable {
private final long usertagsCount; private final long usertagsCount;
private final String publicEmail; private final String publicEmail;
private final HdProfilePicUrlInfo hdProfilePicUrlInfo; private final HdProfilePicUrlInfo hdProfilePicUrlInfo;
private final String profileContext; private final String profileContext; // "also followed by" your friends
private final List<UserProfileContextLink> profileContextLinksWithUserIds; private final List<UserProfileContextLink> profileContextLinksWithUserIds; // ^
private final String socialContext; private final String socialContext; // AYML
// if a DM member is a Facebook user, this is present private final String interopMessagingUserFbid; // in DMs only: Facebook user ID
private final String interopMessagingUserFbid;
public User(final long pk, public User(final long pk,
final String username, final String username,
@ -90,6 +89,52 @@ public class User implements Serializable {
this.interopMessagingUserFbid = interopMessagingUserFbid; this.interopMessagingUserFbid = interopMessagingUserFbid;
} }
public User(final long pk,
final String username,
final String fullName,
final boolean isPrivate,
final String profilePicUrl,
final boolean isVerified) {
this.pk = pk;
this.username = username;
this.fullName = fullName;
this.isPrivate = isPrivate;
this.profilePicUrl = profilePicUrl;
this.profilePicId = null;
this.friendshipStatus = new FriendshipStatus(
false,
false,
false,
false,
false,
false,
false,
false,
false,
false
);
this.isVerified = isVerified;
this.hasAnonymousProfilePicture = false;
this.isUnpublished = false;
this.isFavorite = false;
this.isDirectappInstalled = false;
this.reelAutoArchive = null;
this.allowedCommenterType = null;
this.mediaCount = 0;
this.followerCount = 0;
this.followingCount = 0;
this.followingTagCount = 0;
this.biography = null;
this.externalUrl = null;
this.usertagsCount = 0;
this.publicEmail = null;
this.hdProfilePicUrlInfo = null;
this.profileContext = null;
this.profileContextLinksWithUserIds = null;
this.socialContext = null;
this.interopMessagingUserFbid = null;
}
public long getPk() { public long getPk() {
return pk; return pk;
} }

View File

@ -191,9 +191,7 @@ public class SearchItem {
recentSearch.getName(), recentSearch.getName(),
false, false,
recentSearch.getPicUrl(), recentSearch.getPicUrl(),
null, null, false, false, false, false, false, false
null, null, 0, 0, 0, 0, null, null,
0, null, null, null, null, null, null
); );
} }
@ -205,9 +203,7 @@ public class SearchItem {
favorite.getDisplayName(), favorite.getDisplayName(),
false, false,
favorite.getPicUrl(), favorite.getPicUrl(),
null, null, false, false, false, false, false, false
null, null, 0, 0, 0, 0, null, null,
0, null, null, null, null, null, null
); );
} }

View File

@ -767,11 +767,7 @@ public final class ResponseBodyUtils {
owner.optString("full_name"), owner.optString("full_name"),
false, false,
owner.optString("profile_pic_url"), owner.optString("profile_pic_url"),
null, owner.optBoolean("is_verified"));
friendshipStatus,
owner.optBoolean("is_verified"),
false, false, false, false, null, null, 0, 0, 0, 0, null, null, 0, null, null,
null, null, null, null);
} }
final String id = feedItem.getString(Constants.EXTRAS_ID); final String id = feedItem.getString(Constants.EXTRAS_ID);
VideoVersion videoVersion = null; VideoVersion videoVersion = null;

View File

@ -238,11 +238,7 @@ public class CommentsViewerViewModel extends ViewModel {
null, null,
false, false,
owner.getString("profile_pic_url"), owner.getString("profile_pic_url"),
null, owner.optBoolean("is_verified"));
new FriendshipStatus(false, false, false, false, false, false, false, false, false, false),
owner.optBoolean("is_verified"),
false, false, false, false, null, null, 0, 0, 0, 0, null, null, 0, null, null, null, null,
null, null);
final JSONObject likedBy = commentJsonObject.optJSONObject("edge_liked_by"); final JSONObject likedBy = commentJsonObject.optJSONObject("edge_liked_by");
final String commentId = commentJsonObject.getString("id"); final String commentId = commentJsonObject.getString("id");
final JSONObject childCommentsJsonObject = commentJsonObject.optJSONObject("edge_threaded_comments"); final JSONObject childCommentsJsonObject = commentJsonObject.optJSONObject("edge_threaded_comments");

View File

@ -34,7 +34,6 @@ import retrofit2.Response;
public class GraphQLService extends BaseService { public class GraphQLService extends BaseService {
private static final String TAG = "GraphQLService"; private static final String TAG = "GraphQLService";
// private static final boolean loadFromMock = false;
private final GraphQLRepository repository; private final GraphQLRepository repository;
@ -230,39 +229,7 @@ public class GraphQLService extends BaseService {
userObject.optString("full_name"), userObject.optString("full_name"),
userObject.optBoolean("is_private"), userObject.optBoolean("is_private"),
userObject.getString("profile_pic_url"), userObject.getString("profile_pic_url"),
null, userObject.optBoolean("is_verified")
new FriendshipStatus(
false,
false,
false,
false,
false,
false,
false,
false,
false,
false
),
userObject.optBoolean("is_verified"),
false,
false,
false,
false,
null,
null,
0,
0,
0,
0,
null,
null,
0,
null,
null,
null,
null,
null,
null
)); ));
// userModels.add(new ProfileModel(userObject.optBoolean("is_private"), // userModels.add(new ProfileModel(userObject.optBoolean("is_private"),
// false, // false,

View File

@ -143,39 +143,7 @@ public class StoriesService extends BaseService {
userJson.optString("full_name"), userJson.optString("full_name"),
userJson.optBoolean("is_private"), userJson.optBoolean("is_private"),
userJson.getString("profile_pic_url"), userJson.getString("profile_pic_url"),
null, userJson.optBoolean("is_verified")
new FriendshipStatus(
false,
false,
false,
false,
false,
false,
false,
false,
false,
false
),
userJson.optBoolean("is_verified"),
false,
false,
false,
false,
null,
null,
0,
0,
0,
0,
null,
null,
0,
null,
null,
null,
null,
null,
null
); );
final long timestamp = node.getLong("latest_reel_media"); final long timestamp = node.getLong("latest_reel_media");
final boolean fullyRead = !node.isNull("seen") && node.getLong("seen") == timestamp; final boolean fullyRead = !node.isNull("seen") && node.getLong("seen") == timestamp;
@ -210,39 +178,7 @@ public class StoriesService extends BaseService {
userJson.optString("full_name"), userJson.optString("full_name"),
userJson.optBoolean("is_private"), userJson.optBoolean("is_private"),
userJson.getString("profile_pic_url"), userJson.getString("profile_pic_url"),
null, userJson.optBoolean("is_verified")
new FriendshipStatus(
false,
false,
false,
false,
false,
false,
false,
false,
false,
false
),
userJson.optBoolean("is_verified"),
false,
false,
false,
false,
null,
null,
0,
0,
0,
0,
null,
null,
0,
null,
null,
null,
null,
null,
null
); );
feedStoryModels.add(new FeedStoryModel( feedStoryModels.add(new FeedStoryModel(
node.getString("id"), node.getString("id"),