From e4482841741248f5c8f89ed2d195940e893ef50d Mon Sep 17 00:00:00 2001 From: JustArchi Date: Sat, 12 Jan 2019 19:08:36 +0100 Subject: [PATCH] Misc --- ArchiSteamFarm/Actions.cs | 4 ++-- ArchiSteamFarm/MobileAuthenticator.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ArchiSteamFarm/Actions.cs b/ArchiSteamFarm/Actions.cs index 1ea048c56..cff6658f8 100644 --- a/ArchiSteamFarm/Actions.cs +++ b/ArchiSteamFarm/Actions.cs @@ -57,7 +57,7 @@ namespace ArchiSteamFarm { } [PublicAPI] - public async Task AcceptConfirmations(bool accept, Steam.ConfirmationDetails.EType acceptedType = Steam.ConfirmationDetails.EType.Unknown, IReadOnlyCollection acceptedTradeOfferIDs = null, bool waitIfNeeded = false) { + public async Task AcceptConfirmations(bool accept, Steam.ConfirmationDetails.EType? acceptedType = null, IReadOnlyCollection acceptedTradeOfferIDs = null, bool waitIfNeeded = false) { if (!Bot.HasMobileAuthenticator) { return false; } @@ -82,7 +82,7 @@ namespace ArchiSteamFarm { IList results = await Utilities.InParallel(confirmations.Select(Bot.BotDatabase.MobileAuthenticator.GetConfirmationDetails)).ConfigureAwait(false); - foreach (MobileAuthenticator.Confirmation confirmation in results.Where(details => (details != null) && ((acceptedType != details.Type) || ((details.TradeOfferID != 0) && !acceptedTradeOfferIDs.Contains(details.TradeOfferID)))).Select(details => details.Confirmation)) { + foreach (MobileAuthenticator.Confirmation confirmation in results.Where(details => (details != null) && ((acceptedType.HasValue && (acceptedType.Value != details.Type)) || ((details.TradeOfferID != 0) && !acceptedTradeOfferIDs.Contains(details.TradeOfferID)))).Select(details => details.Confirmation)) { confirmations.Remove(confirmation); } diff --git a/ArchiSteamFarm/MobileAuthenticator.cs b/ArchiSteamFarm/MobileAuthenticator.cs index 350473798..4a6413df2 100644 --- a/ArchiSteamFarm/MobileAuthenticator.cs +++ b/ArchiSteamFarm/MobileAuthenticator.cs @@ -129,7 +129,7 @@ namespace ArchiSteamFarm { } [ItemCanBeNull] - internal async Task> GetConfirmations(Steam.ConfirmationDetails.EType acceptedType = Steam.ConfirmationDetails.EType.Unknown) { + internal async Task> GetConfirmations(Steam.ConfirmationDetails.EType? acceptedType = null) { if (!HasValidDeviceID) { Bot.ArchiLogger.LogGenericError(Strings.ErrorMobileAuthenticatorInvalidDeviceID); @@ -213,7 +213,7 @@ namespace ArchiSteamFarm { return null; } - if ((acceptedType != Steam.ConfirmationDetails.EType.Unknown) && (acceptedType != type)) { + if (acceptedType.HasValue && (acceptedType.Value != type)) { continue; }