mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 14:10:53 +00:00
Fix getting privacy settings (#1866)
* Fix getting privacy settings * Cleanup * Misc
This commit is contained in:
@@ -2626,7 +2626,7 @@ namespace ArchiSteamFarm {
|
||||
return (false, false);
|
||||
}
|
||||
|
||||
IElement htmlNode = htmlDocument.SelectSingleNode("//div[@data-component='ProfilePrivacySettings']/@data-privacysettings");
|
||||
IElement htmlNode = htmlDocument.SelectSingleNode("//div[@id='profile_edit_config']");
|
||||
|
||||
if (htmlNode == null) {
|
||||
Bot.ArchiLogger.LogNullError(nameof(htmlNode));
|
||||
@@ -2634,7 +2634,7 @@ namespace ArchiSteamFarm {
|
||||
return (false, false);
|
||||
}
|
||||
|
||||
string json = htmlNode.GetAttributeValue("data-privacysettings");
|
||||
string json = htmlNode.GetAttributeValue("data-profile-edit");
|
||||
|
||||
if (string.IsNullOrEmpty(json)) {
|
||||
Bot.ArchiLogger.LogNullError(nameof(json));
|
||||
@@ -2648,7 +2648,7 @@ namespace ArchiSteamFarm {
|
||||
Steam.UserPrivacy userPrivacy;
|
||||
|
||||
try {
|
||||
userPrivacy = JsonConvert.DeserializeObject<Steam.UserPrivacy>(json);
|
||||
userPrivacy = JsonConvert.DeserializeObject<Steam.ProfileEditData>(json)?.Privacy;
|
||||
} catch (JsonException e) {
|
||||
Bot.ArchiLogger.LogGenericException(e);
|
||||
|
||||
|
||||
@@ -702,6 +702,15 @@ namespace ArchiSteamFarm.Json {
|
||||
private NewDiscoveryQueueResponse() { }
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "ClassCannotBeInstantiated")]
|
||||
internal sealed class ProfileEditData {
|
||||
[JsonProperty(PropertyName = "Privacy", Required = Required.Always)]
|
||||
internal readonly UserPrivacy Privacy;
|
||||
|
||||
[JsonConstructor]
|
||||
private ProfileEditData() { }
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "ClassCannotBeInstantiated")]
|
||||
internal sealed class RedeemWalletResponse : EResultResponse {
|
||||
[JsonProperty(PropertyName = "wallet", Required = Required.DisallowNull)]
|
||||
|
||||
Reference in New Issue
Block a user