Add family join confirmation type (#3166)

This commit is contained in:
Vita Chumakova
2024-03-20 06:20:23 +04:00
committed by GitHub
parent 9a4fac600a
commit 3bc66e0d27
2 changed files with 8 additions and 2 deletions

View File

@@ -35,6 +35,11 @@ public sealed class Confirmation {
[JsonRequired]
public EConfirmationType ConfirmationType { get; private init; }
[JsonInclude]
[JsonPropertyName("type_text")]
[JsonRequired]
public string ConfirmationTypeText { get; private init; } = null!;
[JsonInclude]
[JsonNumberHandling(JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.WriteAsString)]
[JsonPropertyName("creator_id")]
@@ -67,6 +72,7 @@ public sealed class Confirmation {
Market,
PhoneNumberChange = 5,
AccountRecovery = 6,
ApiKeyRegistration = 9
ApiKeyRegistration = 9,
FamilyJoin = 11
}
}

View File

@@ -183,7 +183,7 @@ public sealed class MobileAuthenticator : IDisposable {
}
foreach (Confirmation? confirmation in response.Confirmations.Where(static confirmation => (confirmation.ConfirmationType == Confirmation.EConfirmationType.Unknown) || !Enum.IsDefined(confirmation.ConfirmationType))) {
Bot.ArchiLogger.LogGenericError(string.Format(CultureInfo.CurrentCulture, Strings.WarningUnknownValuePleaseReport, nameof(confirmation.ConfirmationType), confirmation.ConfirmationType));
Bot.ArchiLogger.LogGenericError(string.Format(CultureInfo.CurrentCulture, Strings.WarningUnknownValuePleaseReport, nameof(confirmation.ConfirmationType), $"{confirmation.ConfirmationType} ({confirmation.ConfirmationTypeText})"));
}
return response.Confirmations;