mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-16 08:25:28 +00:00
Change privacy settings feature (#794)
* Change privacy settings feature * Fixes * Little fix * More fixes * Fix little fuckup
This commit is contained in:
committed by
Łukasz Domeradzki
parent
7c133a799b
commit
9b7dfd065d
@@ -470,18 +470,51 @@ namespace ArchiSteamFarm.Json {
|
||||
|
||||
[SuppressMessage("ReSharper", "ClassCannotBeInstantiated")]
|
||||
internal sealed class PrivacyResponse {
|
||||
[JsonProperty(PropertyName = "PrivacySettings", Required = Required.Always)]
|
||||
internal readonly PrivacySettings Settings;
|
||||
|
||||
// Deserialized from JSON
|
||||
private PrivacyResponse() { }
|
||||
|
||||
internal PrivacyResponse(PrivacySettings.EPrivacySetting profile, PrivacySettings.EPrivacySetting ownedGames, PrivacySettings.EPrivacySetting playtime, PrivacySettings.EPrivacySetting inventory, PrivacySettings.EPrivacySetting inventoryGifts, PrivacySettings.EPrivacySetting comments) {
|
||||
if ((profile == PrivacySettings.EPrivacySetting.Unknown) || (ownedGames == PrivacySettings.EPrivacySetting.Unknown) || (playtime == PrivacySettings.EPrivacySetting.Unknown) || (inventory == PrivacySettings.EPrivacySetting.Unknown) || (inventoryGifts == PrivacySettings.EPrivacySetting.Unknown) || (comments == PrivacySettings.EPrivacySetting.Unknown)) {
|
||||
throw new ArgumentNullException(nameof(profile) + " || " + nameof(ownedGames) + " || " + nameof(playtime) + " || " + nameof(inventory) + " || " + nameof(inventoryGifts) + " || " + nameof(comments));
|
||||
}
|
||||
|
||||
Settings = new PrivacySettings(profile, ownedGames, playtime, inventory, inventoryGifts);
|
||||
Comments = comments;
|
||||
}
|
||||
|
||||
[JsonProperty(PropertyName = "PrivacySettings", Required = Required.Always)]
|
||||
internal readonly PrivacySettings Settings;
|
||||
|
||||
[JsonProperty(PropertyName = "eCommentPermission", Required = Required.Always)]
|
||||
internal readonly PrivacySettings.EPrivacySetting Comments;
|
||||
|
||||
internal sealed class PrivacySettings {
|
||||
internal PrivacySettings(EPrivacySetting profile, EPrivacySetting ownedGames, EPrivacySetting playtime, EPrivacySetting inventory, EPrivacySetting inventoryGifts) {
|
||||
if ((profile == EPrivacySetting.Unknown) || (ownedGames == EPrivacySetting.Unknown) || (playtime == EPrivacySetting.Unknown) || (inventory == EPrivacySetting.Unknown) || (inventoryGifts == EPrivacySetting.Unknown)) {
|
||||
throw new ArgumentNullException(nameof(profile) + " || " + nameof(ownedGames) + " || " + nameof(playtime) + " || " + nameof(inventory) + " || " + nameof(inventoryGifts));
|
||||
}
|
||||
|
||||
Profile = profile;
|
||||
OwnedGames = ownedGames;
|
||||
Playtime = playtime;
|
||||
Inventory = inventory;
|
||||
InventoryGifts = inventoryGifts;
|
||||
}
|
||||
|
||||
[JsonProperty(PropertyName = "PrivacyInventory", Required = Required.Always)]
|
||||
internal readonly EPrivacySetting Inventory;
|
||||
|
||||
// Deserialized from JSON
|
||||
private PrivacySettings() { }
|
||||
[JsonProperty(PropertyName = "PrivacyProfile", Required = Required.Always)]
|
||||
internal readonly EPrivacySetting Profile;
|
||||
|
||||
[JsonProperty(PropertyName = "PrivacyInventoryGifts", Required = Required.Always)]
|
||||
internal readonly EPrivacySetting InventoryGifts;
|
||||
|
||||
[JsonProperty(PropertyName = "PrivacyOwnedGames", Required = Required.Always)]
|
||||
internal readonly EPrivacySetting OwnedGames;
|
||||
|
||||
[JsonProperty(PropertyName = "PrivacyPlaytime", Required = Required.Always)]
|
||||
internal readonly EPrivacySetting Playtime;
|
||||
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
internal enum EPrivacySetting : byte {
|
||||
@@ -491,6 +524,12 @@ namespace ArchiSteamFarm.Json {
|
||||
Public
|
||||
}
|
||||
}
|
||||
|
||||
internal enum ECommentPermission {
|
||||
FriendsOnly = 0,
|
||||
Public = 1,
|
||||
Private = 2
|
||||
}
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "ClassCannotBeInstantiated")]
|
||||
|
||||
Reference in New Issue
Block a user