Some more cleanup.

This commit is contained in:
Burak Kaan Köse
2026-04-05 13:18:50 +02:00
parent c1ab49fb1d
commit ca19297b92
22 changed files with 444 additions and 302 deletions
@@ -9,22 +9,18 @@ public class ImapClientPoolException : Exception
{
}
public ImapClientPoolException(string message, CustomServerInformation customServerInformation, string protocolLog) : base(message)
public ImapClientPoolException(string message, CustomServerInformation customServerInformation) : base(message)
{
CustomServerInformation = customServerInformation;
ProtocolLog = protocolLog;
}
public ImapClientPoolException(string message, string protocolLog) : base(message)
public ImapClientPoolException(string message) : base(message)
{
ProtocolLog = protocolLog;
}
public ImapClientPoolException(Exception innerException, string protocolLog) : base(innerException.Message, innerException)
public ImapClientPoolException(Exception innerException) : base(innerException.Message, innerException)
{
ProtocolLog = protocolLog;
}
public CustomServerInformation CustomServerInformation { get; }
public string ProtocolLog { get; }
}
@@ -1,17 +0,0 @@
using Wino.Core.Domain.Models.AutoDiscovery;
namespace Wino.Core.Domain.Exceptions;
public class ImapConnectionFailedPackage
{
public ImapConnectionFailedPackage(string errorMessage, string protocolLog, AutoDiscoverySettings settings)
{
ErrorMessage = errorMessage;
ProtocolLog = protocolLog;
Settings = settings;
}
public AutoDiscoverySettings Settings { get; }
public string ErrorMessage { get; set; }
public string ProtocolLog { get; }
}
@@ -182,11 +182,6 @@ public interface IPreferencesService : INotifyPropertyChanged
/// </summary>
MailOperation RightHoverAction { get; set; }
/// <summary>
/// Setting: Whether Mailkit Protocol Logger is enabled for ImapTestService or not.
/// </summary>
bool IsMailkitProtocolLoggerEnabled { get; set; }
/// <summary>
/// Setting: Which entity id (merged account or folder) should be expanded automatically on startup.
/// </summary>
@@ -1,24 +1,21 @@
using System.IO;
using Wino.Core.Domain.Entities.Shared;
namespace Wino.Core.Domain.Models.Connectivity;
public class ImapClientPoolOptions
{
public Stream ProtocolLog { get; }
public CustomServerInformation ServerInformation { get; }
public bool IsTestPool { get; }
protected ImapClientPoolOptions(CustomServerInformation serverInformation, Stream protocolLog, bool isTestPool)
protected ImapClientPoolOptions(CustomServerInformation serverInformation, bool isTestPool)
{
ServerInformation = serverInformation;
ProtocolLog = protocolLog;
IsTestPool = isTestPool;
}
public static ImapClientPoolOptions CreateDefault(CustomServerInformation serverInformation, Stream protocolLog)
=> new(serverInformation, protocolLog, false);
public static ImapClientPoolOptions CreateDefault(CustomServerInformation serverInformation)
=> new(serverInformation, false);
public static ImapClientPoolOptions CreateTestPool(CustomServerInformation serverInformation, Stream protocolLog)
=> new(serverInformation, protocolLog, true);
public static ImapClientPoolOptions CreateTestPool(CustomServerInformation serverInformation)
=> new(serverInformation, true);
}
@@ -18,13 +18,10 @@ public class ImapConnectivityTestResults
public bool IsCertificateUIRequired { get; set; }
public string FailedReason { get; set; }
public string FailureProtocolLog { get; set; }
public static ImapConnectivityTestResults Success() => new ImapConnectivityTestResults() { IsSuccess = true };
public static ImapConnectivityTestResults Failure(Exception ex, string failureProtocolLog) => new ImapConnectivityTestResults()
public static ImapConnectivityTestResults Failure(Exception ex) => new ImapConnectivityTestResults()
{
FailedReason = string.Join(Environment.NewLine, ex.GetInnerExceptions().Select(e => e.Message)),
FailureProtocolLog = failureProtocolLog
FailedReason = string.Join(Environment.NewLine, ex.GetInnerExceptions().Select(e => e.Message))
};
public static ImapConnectivityTestResults CertificateUIRequired(string issuer,
@@ -664,7 +664,6 @@
"PaneLengthOption_Small": "Small",
"Photos": "Photos",
"PreparingFoldersMessage": "Preparing folders",
"ProtocolLogAvailable_Message": "Protocol logs are available for diagnostics.",
"ProviderDetail_Gmail_Description": "Google Account",
"ProviderDetail_iCloud_Description": "Apple iCloud Account",
"ProviderDetail_iCloud_Title": "iCloud",