Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed typo and corresponding references #233

Merged
merged 1 commit into from
Jan 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions InstaSharper/API/InstaApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1046,8 +1046,8 @@ public async Task<IResult<InstaLoginResult>> LoginAsync()
var loginInfo = JsonConvert.DeserializeObject<InstaLoginResponse>(json);
IsUserAuthenticated = loginInfo.User?.UserName.ToLower() == _user.UserName.ToLower();
var converter = ConvertersFabric.Instance.GetUserShortConverter(loginInfo.User);
_user.LoggedInUder = converter.Convert();
_user.RankToken = $"{_user.LoggedInUder.Pk}_{_httpRequestProcessor.RequestMessage.phone_id}";
_user.LoggedInUser = converter.Convert();
_user.RankToken = $"{_user.LoggedInUser.Pk}_{_httpRequestProcessor.RequestMessage.phone_id}";
return Result.Success(InstaLoginResult.Success);
}
catch (Exception exception)
Expand Down Expand Up @@ -1179,8 +1179,8 @@ public async Task<IResult<InstaResetChallenge>> SendVerifyCode(string securityCo
var sendVerifyCodeResponse = JsonConvert.DeserializeObject<InstaResetChallenge>(json);
IsUserAuthenticated = sendVerifyCodeResponse.LoggedInUser?.UserName.ToLower() == _user.UserName.ToLower();
var converter = ConvertersFabric.Instance.GetUserShortConverter(sendVerifyCodeResponse.LoggedInUser);
_user.LoggedInUder = converter.Convert();
_user.RankToken = $"{_user.LoggedInUder.Pk}_{_httpRequestProcessor.RequestMessage.phone_id}";
_user.LoggedInUser = converter.Convert();
_user.RankToken = $"{_user.LoggedInUser.Pk}_{_httpRequestProcessor.RequestMessage.phone_id}";
return Result.Success(sendVerifyCodeResponse);
}

Expand Down Expand Up @@ -1233,8 +1233,8 @@ public async Task<IResult<InstaLoginTwoFactorResult>> TwoFactorLoginAsync(string
IsUserAuthenticated = IsUserAuthenticated =
loginInfo.User != null && loginInfo.User.UserName.ToLower() == _user.UserName.ToLower();
var converter = ConvertersFabric.Instance.GetUserShortConverter(loginInfo.User);
_user.LoggedInUder = converter.Convert();
_user.RankToken = $"{_user.LoggedInUder.Pk}_{_httpRequestProcessor.RequestMessage.phone_id}";
_user.LoggedInUser = converter.Convert();
_user.RankToken = $"{_user.LoggedInUser.Pk}_{_httpRequestProcessor.RequestMessage.phone_id}";

return Result.Success(InstaLoginTwoFactorResult.Success);
}
Expand Down
6 changes: 3 additions & 3 deletions InstaSharper/API/Processors/CollectionProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public async Task<IResult<InstaCollectionItem>> CreateCollectionAsync(string col
var data = new JObject
{
{"_uuid", _deviceInfo.DeviceGuid.ToString()},
{"_uid", _user.LoggedInUder.Pk},
{"_uid", _user.LoggedInUser.Pk},
{"_csrftoken", _user.CsrfToken},
{"name", collectionName},
{"module_name", InstaApiConstants.COLLECTION_CREATE_MODULE}
Expand Down Expand Up @@ -122,7 +122,7 @@ public async Task<IResult<bool>> DeleteCollectionAsync(long collectionId)
var data = new JObject
{
{"_uuid", _deviceInfo.DeviceGuid.ToString()},
{"_uid", _user.LoggedInUder.Pk},
{"_uid", _user.LoggedInUser.Pk},
{"_csrftoken", _user.CsrfToken},
{"module_name", "collection_editor"}
};
Expand Down Expand Up @@ -159,7 +159,7 @@ public async Task<IResult<InstaCollectionItem>> AddItemsToCollectionAsync(long c
{"added_media_ids", JsonConvert.SerializeObject(mediaIds)},
{"radio_type", "wifi-none"},
{"_uuid", _deviceInfo.DeviceGuid.ToString()},
{"_uid", _user.LoggedInUder.Pk},
{"_uid", _user.LoggedInUser.Pk},
{"_csrftoken", _user.CsrfToken}
};

Expand Down
4 changes: 2 additions & 2 deletions InstaSharper/API/Processors/CommentProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public async Task<IResult<InstaComment>> CommentMediaAsync(string mediaId, strin
{"user_breadcrumb", breadcrumb},
{"idempotence_token", Guid.NewGuid().ToString()},
{"_uuid", _deviceInfo.DeviceGuid.ToString()},
{"_uid", _user.LoggedInUder.Pk.ToString()},
{"_uid", _user.LoggedInUser.Pk.ToString()},
{"_csrftoken", _user.CsrfToken},
{"comment_text", text},
{"containermodule", "comments_feed_timeline"},
Expand Down Expand Up @@ -116,7 +116,7 @@ public async Task<IResult<bool>> DeleteCommentAsync(string mediaId, string comme
var fields = new Dictionary<string, string>
{
{"_uuid", _deviceInfo.DeviceGuid.ToString()},
{"_uid", _user.LoggedInUder.Pk.ToString()},
{"_uid", _user.LoggedInUser.Pk.ToString()},
{"_csrftoken", _user.CsrfToken}
};
var request =
Expand Down
2 changes: 1 addition & 1 deletion InstaSharper/API/Processors/LocationProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public async Task<IResult<InstaLocationShortList>> Search(double latitude, doubl
var fields = new Dictionary<string, string>
{
{"_uuid", _deviceInfo.DeviceGuid.ToString()},
{"_uid", _user.LoggedInUder.Pk.ToString()},
{"_uid", _user.LoggedInUser.Pk.ToString()},
{"_csrftoken", _user.CsrfToken},
{"latitude", latitude.ToString(CultureInfo.InvariantCulture)},
{"longitude", longitude.ToString(CultureInfo.InvariantCulture)},
Expand Down
16 changes: 8 additions & 8 deletions InstaSharper/API/Processors/MediaProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public async Task<IResult<bool>> DeleteMediaAsync(string mediaId, InstaMediaType
var data = new JObject
{
{"_uuid", _deviceInfo.DeviceGuid.ToString()},
{"_uid", _user.LoggedInUder.Pk},
{"_uid", _user.LoggedInUser.Pk},
{"_csrftoken", _user.CsrfToken},
{"media_id", mediaId}
};
Expand Down Expand Up @@ -98,7 +98,7 @@ public async Task<IResult<bool>> EditMediaAsync(string mediaId, string caption)
var data = new JObject
{
{"_uuid", _deviceInfo.DeviceGuid.ToString()},
{"_uid", _user.LoggedInUder.Pk},
{"_uid", _user.LoggedInUser.Pk},
{"_csrftoken", _user.CsrfToken},
{"caption_text", caption}
};
Expand Down Expand Up @@ -263,7 +263,7 @@ public async Task<IResult<InstaMedia>> ConfigureVideoAsync(InstaVideo video, str
{"video_result", "deprecated"},
{"_csrftoken", _user.CsrfToken},
{"_uuid", _deviceInfo.DeviceGuid.ToString()},
{"_uid", _user.LoggedInUder.UserName}
{"_uid", _user.LoggedInUser.UserName}
};

var request = HttpHelper.GetSignedRequest(HttpMethod.Post, instaUri, _deviceInfo, data);
Expand Down Expand Up @@ -293,10 +293,10 @@ public async Task<IResult<InstaMedia>> ExposeVideoAsync(string uploadId)
var data = new JObject
{
{"_uuid", _deviceInfo.DeviceGuid.ToString()},
{"_uid", _user.LoggedInUder.Pk},
{"_uid", _user.LoggedInUser.Pk},
{"_csrftoken", _user.CsrfToken},
{"experiment", "ig_android_profile_contextual_feed"},
{"id", _user.LoggedInUder.Pk},
{"id", _user.LoggedInUser.Pk},
{"upload_id", uploadId}
};

Expand Down Expand Up @@ -416,7 +416,7 @@ public async Task<IResult<InstaMedia>> ConfigurePhotoAsync(InstaImage image, str
var data = new JObject
{
{"_uuid", _deviceInfo.DeviceGuid.ToString()},
{"_uid", _user.LoggedInUder.Pk},
{"_uid", _user.LoggedInUser.Pk},
{"_csrftoken", _user.CsrfToken},
{"media_folder", "Camera"},
{"source_type", "4"},
Expand Down Expand Up @@ -489,7 +489,7 @@ public async Task<IResult<InstaMedia>> ConfigureAlbumAsync(string[] uploadId, st
var data = new JObject
{
{"_uuid", _deviceInfo.DeviceGuid.ToString()},
{"_uid", _user.LoggedInUder.Pk},
{"_uid", _user.LoggedInUser.Pk},
{"_csrftoken", _user.CsrfToken},
{"caption", caption},
{"client_sidecar_id", clientSidecarId},
Expand Down Expand Up @@ -622,7 +622,7 @@ private async Task<IResult<bool>> LikeUnlikeMediaInternal(string mediaId, Uri in
var fields = new Dictionary<string, string>
{
{"_uuid", _deviceInfo.DeviceGuid.ToString()},
{"_uid", _user.LoggedInUder.Pk.ToString()},
{"_uid", _user.LoggedInUser.Pk.ToString()},
{"_csrftoken", _user.CsrfToken},
{"media_id", mediaId}
};
Expand Down
2 changes: 1 addition & 1 deletion InstaSharper/API/Processors/StoryProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public async Task<IResult<InstaStoryMedia>> ConfigureStoryPhotoAsync(InstaImage
var data = new JObject
{
{"_uuid", _deviceInfo.DeviceGuid.ToString()},
{"_uid", _user.LoggedInUder.Pk},
{"_uid", _user.LoggedInUser.Pk},
{"_csrftoken", _user.CsrfToken},
{"source_type", "1"},
{"caption", caption},
Expand Down
6 changes: 3 additions & 3 deletions InstaSharper/API/Processors/UserProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public async Task<IResult<InstaCurrentUser>> GetCurrentUserAsync()
var fields = new Dictionary<string, string>
{
{"_uuid", _deviceInfo.DeviceGuid.ToString()},
{"_uid", _user.LoggedInUder.Pk.ToString()},
{"_uid", _user.LoggedInUser.Pk.ToString()},
{"_csrftoken", _user.CsrfToken}
};
var request = HttpHelper.GetDefaultRequest(HttpMethod.Post, instaUri, _deviceInfo);
Expand Down Expand Up @@ -400,7 +400,7 @@ private async Task<IResult<InstaFriendshipStatus>> FollowUnfollowUserInternal(lo
var fields = new Dictionary<string, string>
{
{"_uuid", _deviceInfo.DeviceGuid.ToString()},
{"_uid", _user.LoggedInUder.Pk.ToString()},
{"_uid", _user.LoggedInUser.Pk.ToString()},
{"_csrftoken", _user.CsrfToken},
{"user_id", userId.ToString()},
{"radio_type", "wifi-none"}
Expand Down Expand Up @@ -430,7 +430,7 @@ private async Task<IResult<InstaFriendshipStatus>> BlockUnblockUserInternal(long
var fields = new Dictionary<string, string>
{
{"_uuid", _deviceInfo.DeviceGuid.ToString()},
{"_uid", _user.LoggedInUder.Pk.ToString()},
{"_uid", _user.LoggedInUser.Pk.ToString()},
{"_csrftoken", _user.CsrfToken},
{"user_id", userId.ToString()},
{"radio_type", "wifi-none"}
Expand Down
6 changes: 3 additions & 3 deletions InstaSharper/API/Processors/UserProfileProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public async Task<IResult<InstaUserShort>> SetAccountPrivateAsync()
var fields = new Dictionary<string, string>
{
{"_uuid", _deviceInfo.DeviceGuid.ToString()},
{"_uid", _user.LoggedInUder.Pk.ToString()},
{"_uid", _user.LoggedInUser.Pk.ToString()},
{"_csrftoken", _user.CsrfToken}
};
var hash = CryptoHelper.CalculateHash(InstaApiConstants.IG_SIGNATURE_KEY,
Expand Down Expand Up @@ -78,7 +78,7 @@ public async Task<IResult<InstaUserShort>> SetAccountPublicAsync()
var fields = new Dictionary<string, string>
{
{"_uuid", _deviceInfo.DeviceGuid.ToString()},
{"_uid", _user.LoggedInUder.Pk.ToString()},
{"_uid", _user.LoggedInUser.Pk.ToString()},
{"_csrftoken", _user.CsrfToken}
};
var hash = CryptoHelper.CalculateHash(InstaApiConstants.IG_SIGNATURE_KEY,
Expand Down Expand Up @@ -123,7 +123,7 @@ public async Task<IResult<bool>> ChangePasswordAsync(string oldPassword, string
var data = new JObject
{
{"_uuid", _deviceInfo.DeviceGuid.ToString()},
{"_uid", _user.LoggedInUder.Pk},
{"_uid", _user.LoggedInUser.Pk},
{"_csrftoken", _user.CsrfToken},
{"old_password", oldPassword},
{"new_password1", newPassword},
Expand Down
2 changes: 1 addition & 1 deletion InstaSharper/Classes/UserSessionData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class UserSessionData
public string UserName { get; set; }
public string Password { get; set; }

public InstaUserShort LoggedInUder { get; set; }
public InstaUserShort LoggedInUser { get; set; }

public string RankToken { get; set; }
public string CsrfToken { get; set; }
Expand Down