Fixed iCloud/Yahoo special providers and implemented more calendar metadata to support calendar colors in CalDav synchronizer.

This commit is contained in:
Burak Kaan Köse
2026-04-22 09:55:13 +02:00
parent 890bfc84f1
commit d66015bebd
8 changed files with 585 additions and 14 deletions
@@ -613,6 +613,7 @@ public partial class ImapCalDavSettingsPageViewModel : MailBaseViewModel
var normalizedEmail = !string.IsNullOrWhiteSpace(EmailAddress) && !EmailAddress.Contains('@')
? $"{EmailAddress}@icloud.com"
: EmailAddress;
var iCloudMailboxUsername = GetICloudMailboxUsername(normalizedEmail);
if (!string.IsNullOrWhiteSpace(accountCreationDialogResult?.SpecialImapProviderDetails?.SenderName))
DisplayName = accountCreationDialogResult.SpecialImapProviderDetails.SenderName;
@@ -632,10 +633,10 @@ public partial class ImapCalDavSettingsPageViewModel : MailBaseViewModel
ApplySpecialProviderDefaults(
"imap.mail.me.com",
"993",
normalizedEmail,
iCloudMailboxUsername,
"smtp.mail.me.com",
"587",
normalizedEmail,
iCloudMailboxUsername,
Password,
"https://caldav.icloud.com/",
normalizedEmail,
@@ -714,6 +715,19 @@ public partial class ImapCalDavSettingsPageViewModel : MailBaseViewModel
OutgoingServerPort = "587";
}
private static string GetICloudMailboxUsername(string emailAddress)
{
if (string.IsNullOrWhiteSpace(emailAddress))
return string.Empty;
var normalizedAddress = emailAddress.Trim();
var atIndex = normalizedAddress.IndexOf('@');
return atIndex > 0
? normalizedAddress[..atIndex]
: normalizedAddress;
}
private static string ReplaceIfEmptyOrMatchingPrevious(string currentValue, string previousValue, string replacementValue)
{
var normalizedCurrentValue = currentValue?.Trim() ?? string.Empty;