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; }