mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-06 17:10:13 +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);
|
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) {
|
if (htmlNode == null) {
|
||||||
Bot.ArchiLogger.LogNullError(nameof(htmlNode));
|
Bot.ArchiLogger.LogNullError(nameof(htmlNode));
|
||||||
@@ -2634,7 +2634,7 @@ namespace ArchiSteamFarm {
|
|||||||
return (false, false);
|
return (false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
string json = htmlNode.GetAttributeValue("data-privacysettings");
|
string json = htmlNode.GetAttributeValue("data-profile-edit");
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(json)) {
|
if (string.IsNullOrEmpty(json)) {
|
||||||
Bot.ArchiLogger.LogNullError(nameof(json));
|
Bot.ArchiLogger.LogNullError(nameof(json));
|
||||||
@@ -2648,7 +2648,7 @@ namespace ArchiSteamFarm {
|
|||||||
Steam.UserPrivacy userPrivacy;
|
Steam.UserPrivacy userPrivacy;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
userPrivacy = JsonConvert.DeserializeObject<Steam.UserPrivacy>(json);
|
userPrivacy = JsonConvert.DeserializeObject<Steam.ProfileEditData>(json)?.Privacy;
|
||||||
} catch (JsonException e) {
|
} catch (JsonException e) {
|
||||||
Bot.ArchiLogger.LogGenericException(e);
|
Bot.ArchiLogger.LogGenericException(e);
|
||||||
|
|
||||||
|
|||||||
@@ -702,6 +702,15 @@ namespace ArchiSteamFarm.Json {
|
|||||||
private NewDiscoveryQueueResponse() { }
|
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")]
|
[SuppressMessage("ReSharper", "ClassCannotBeInstantiated")]
|
||||||
internal sealed class RedeemWalletResponse : EResultResponse {
|
internal sealed class RedeemWalletResponse : EResultResponse {
|
||||||
[JsonProperty(PropertyName = "wallet", Required = Required.DisallowNull)]
|
[JsonProperty(PropertyName = "wallet", Required = Required.DisallowNull)]
|
||||||
|
|||||||
Reference in New Issue
Block a user