Compare commits
8 Commits
feature/Im
...
v1.8.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bc4838578e | ||
|
|
548996405a | ||
|
|
a9a5f0bd14 | ||
|
|
ec05ff6123 | ||
|
|
10c7ab421b | ||
|
|
a8a5cc53ea | ||
|
|
8fe48ca438 | ||
|
|
cbd5a515a9 |
@@ -103,9 +103,9 @@ namespace Wino.Core.Domain.Interfaces
|
|||||||
/// Creates a draft MailCopy and MimeMessage based on the given options.
|
/// Creates a draft MailCopy and MimeMessage based on the given options.
|
||||||
/// For forward/reply it would include the referenced message.
|
/// For forward/reply it would include the referenced message.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="composerAccount">Account which should have new draft.</param>
|
/// <param name="accountId">AccountId which should have new draft.</param>
|
||||||
/// <param name="draftCreationOptions">Options like new email/forward/draft.</param>
|
/// <param name="draftCreationOptions">Options like new email/forward/draft.</param>
|
||||||
/// <returns>Draft MailCopy and Draft MimeMessage as base64.</returns>
|
/// <returns>Draft MailCopy and Draft MimeMessage as base64.</returns>
|
||||||
Task<(MailCopy draftMailCopy, string draftBase64MimeMessage)> CreateDraftAsync(MailAccount composerAccount, DraftCreationOptions draftCreationOptions);
|
Task<(MailCopy draftMailCopy, string draftBase64MimeMessage)> CreateDraftAsync(Guid accountId, DraftCreationOptions draftCreationOptions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,12 +109,12 @@ namespace Wino.Core.UWP.Services
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ConnectingHandle ??= new TaskCompletionSource<bool>();
|
ConnectingHandle = new TaskCompletionSource<bool>();
|
||||||
|
|
||||||
var connectionCancellationToken = new CancellationTokenSource(TimeSpan.FromMilliseconds(ServerConnectionTimeoutMs));
|
|
||||||
|
|
||||||
Status = WinoServerConnectionStatus.Connecting;
|
Status = WinoServerConnectionStatus.Connecting;
|
||||||
|
|
||||||
|
var connectionCancellationToken = new CancellationTokenSource(TimeSpan.FromMilliseconds(ServerConnectionTimeoutMs));
|
||||||
|
|
||||||
await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync();
|
await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync();
|
||||||
|
|
||||||
// Connection establishment handler is in App.xaml.cs OnBackgroundActivated.
|
// Connection establishment handler is in App.xaml.cs OnBackgroundActivated.
|
||||||
@@ -125,10 +125,21 @@ namespace Wino.Core.UWP.Services
|
|||||||
|
|
||||||
Log.Information("Server connection established successfully.");
|
Log.Information("Server connection established successfully.");
|
||||||
}
|
}
|
||||||
|
catch (OperationCanceledException canceledException)
|
||||||
|
{
|
||||||
|
Log.Error(canceledException, $"Server process did not start in {ServerConnectionTimeoutMs} ms. Operation is canceled.");
|
||||||
|
|
||||||
|
ConnectingHandle?.TrySetException(canceledException);
|
||||||
|
|
||||||
|
Status = WinoServerConnectionStatus.Failed;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Log.Error(ex, "Failed to connect to the server.");
|
Log.Error(ex, "Failed to connect to the server.");
|
||||||
|
|
||||||
|
ConnectingHandle?.TrySetException(ex);
|
||||||
|
|
||||||
Status = WinoServerConnectionStatus.Failed;
|
Status = WinoServerConnectionStatus.Failed;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,8 +51,9 @@ namespace Wino.Core.Services
|
|||||||
_preferencesService = preferencesService;
|
_preferencesService = preferencesService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<(MailCopy draftMailCopy, string draftBase64MimeMessage)> CreateDraftAsync(MailAccount composerAccount, DraftCreationOptions draftCreationOptions)
|
public async Task<(MailCopy draftMailCopy, string draftBase64MimeMessage)> CreateDraftAsync(Guid accountId, DraftCreationOptions draftCreationOptions)
|
||||||
{
|
{
|
||||||
|
var composerAccount = await _accountService.GetAccountAsync(accountId).ConfigureAwait(false);
|
||||||
var createdDraftMimeMessage = await CreateDraftMimeAsync(composerAccount, draftCreationOptions);
|
var createdDraftMimeMessage = await CreateDraftMimeAsync(composerAccount, draftCreationOptions);
|
||||||
|
|
||||||
var draftFolder = await _folderService.GetSpecialFolderByAccountIdAsync(composerAccount.Id, SpecialFolderType.Draft);
|
var draftFolder = await _folderService.GetSpecialFolderByAccountIdAsync(composerAccount.Id, SpecialFolderType.Draft);
|
||||||
|
|||||||
@@ -922,7 +922,7 @@ namespace Wino.Core.Synchronizers
|
|||||||
}
|
}
|
||||||
|
|
||||||
// In case of the high input, we'll batch them by 50 to reflect changes quickly.
|
// In case of the high input, we'll batch them by 50 to reflect changes quickly.
|
||||||
var batchedMissingMailIds = missingMailIds.Batch(50).Select(a => new UniqueIdSet(a, SortOrder.Descending));
|
var batchedMissingMailIds = missingMailIds.Batch(50).Select(a => new UniqueIdSet(a, SortOrder.Ascending));
|
||||||
|
|
||||||
foreach (var batchMissingMailIds in batchedMissingMailIds)
|
foreach (var batchMissingMailIds in batchedMissingMailIds)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -777,7 +777,7 @@ namespace Wino.Mail.ViewModels
|
|||||||
MailToUri = _launchProtocolService.MailToUri
|
MailToUri = _launchProtocolService.MailToUri
|
||||||
};
|
};
|
||||||
|
|
||||||
var (draftMailCopy, draftBase64MimeMessage) = await _mailService.CreateDraftAsync(account, draftOptions).ConfigureAwait(false);
|
var (draftMailCopy, draftBase64MimeMessage) = await _mailService.CreateDraftAsync(account.Id, draftOptions).ConfigureAwait(false);
|
||||||
|
|
||||||
var draftPreparationRequest = new DraftPreparationRequest(account, draftMailCopy, draftBase64MimeMessage);
|
var draftPreparationRequest = new DraftPreparationRequest(account, draftMailCopy, draftBase64MimeMessage);
|
||||||
await _winoRequestDelegator.ExecuteAsync(draftPreparationRequest);
|
await _winoRequestDelegator.ExecuteAsync(draftPreparationRequest);
|
||||||
|
|||||||
@@ -610,6 +610,9 @@ namespace Wino.Mail.ViewModels
|
|||||||
|
|
||||||
if (ActiveFolder == null) return;
|
if (ActiveFolder == null) return;
|
||||||
|
|
||||||
|
// At least accounts must match.
|
||||||
|
if (ActiveFolder.HandlingFolders.Any(a => a.MailAccountId != addedMail.AssignedAccount.Id)) return;
|
||||||
|
|
||||||
// Messages coming to sent or draft folder must be inserted regardless of the filter.
|
// Messages coming to sent or draft folder must be inserted regardless of the filter.
|
||||||
bool shouldPreventIgnoringFilter = addedMail.AssignedFolder.SpecialFolderType == SpecialFolderType.Draft ||
|
bool shouldPreventIgnoringFilter = addedMail.AssignedFolder.SpecialFolderType == SpecialFolderType.Draft ||
|
||||||
addedMail.AssignedFolder.SpecialFolderType == SpecialFolderType.Sent;
|
addedMail.AssignedFolder.SpecialFolderType == SpecialFolderType.Sent;
|
||||||
@@ -617,6 +620,7 @@ namespace Wino.Mail.ViewModels
|
|||||||
// Item does not belong to this folder and doesn't have special type to be inserted.
|
// Item does not belong to this folder and doesn't have special type to be inserted.
|
||||||
if (!shouldPreventIgnoringFilter && !ActiveFolder.HandlingFolders.Any(a => a.Id == addedMail.AssignedFolder.Id)) return;
|
if (!shouldPreventIgnoringFilter && !ActiveFolder.HandlingFolders.Any(a => a.Id == addedMail.AssignedFolder.Id)) return;
|
||||||
|
|
||||||
|
// Item should be prevented from being added to the list due to filter.
|
||||||
if (!shouldPreventIgnoringFilter && ShouldPreventItemAdd(addedMail)) return;
|
if (!shouldPreventIgnoringFilter && ShouldPreventItemAdd(addedMail)) return;
|
||||||
|
|
||||||
await MailCollection.AddAsync(addedMail);
|
await MailCollection.AddAsync(addedMail);
|
||||||
|
|||||||
@@ -271,7 +271,7 @@ namespace Wino.Mail.ViewModels
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var (draftMailCopy, draftBase64MimeMessage) = await _mailService.CreateDraftAsync(initializedMailItemViewModel.AssignedAccount, draftOptions).ConfigureAwait(false);
|
var (draftMailCopy, draftBase64MimeMessage) = await _mailService.CreateDraftAsync(initializedMailItemViewModel.AssignedAccount.Id, draftOptions).ConfigureAwait(false);
|
||||||
|
|
||||||
var draftPreparationRequest = new DraftPreparationRequest(initializedMailItemViewModel.AssignedAccount, draftMailCopy, draftBase64MimeMessage, initializedMailItemViewModel.MailCopy);
|
var draftPreparationRequest = new DraftPreparationRequest(initializedMailItemViewModel.AssignedAccount, draftMailCopy, draftBase64MimeMessage, initializedMailItemViewModel.MailCopy);
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,7 @@
|
|||||||
Description="Mail client designed for Windows 11"
|
Description="Mail client designed for Windows 11"
|
||||||
BackgroundColor="transparent">
|
BackgroundColor="transparent">
|
||||||
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" Square71x71Logo="Assets\SmallTile.png" Square310x310Logo="Assets\LargeTile.png"/>
|
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" Square71x71Logo="Assets\SmallTile.png" Square310x310Logo="Assets\LargeTile.png"/>
|
||||||
<uap:SplashScreen Image="Assets\SplashScreen.png" BackgroundColor="transparent"/>
|
<uap:SplashScreen Image="Assets\SplashScreen.png" BackgroundColor="transparent" uap5:Optional="true" />
|
||||||
<uap:LockScreen BadgeLogo="Assets\BadgeLogo.png" Notification="badgeAndTileText"/>
|
<uap:LockScreen BadgeLogo="Assets\BadgeLogo.png" Notification="badgeAndTileText"/>
|
||||||
</uap:VisualElements>
|
</uap:VisualElements>
|
||||||
<Extensions>
|
<Extensions>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<Identity
|
<Identity
|
||||||
Name="58272BurakKSE.WinoMailPreview"
|
Name="58272BurakKSE.WinoMailPreview"
|
||||||
Publisher="CN=51FBDAF3-E212-4149-89A2-A2636B3BC911"
|
Publisher="CN=51FBDAF3-E212-4149-89A2-A2636B3BC911"
|
||||||
Version="1.8.0.0" />
|
Version="1.8.1.0" />
|
||||||
|
|
||||||
<Extensions>
|
<Extensions>
|
||||||
<!-- Publisher Cache Folders -->
|
<!-- Publisher Cache Folders -->
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
Square150x150Logo="Images\Square150x150Logo.png"
|
Square150x150Logo="Images\Square150x150Logo.png"
|
||||||
Square44x44Logo="Images\Square44x44Logo.png">
|
Square44x44Logo="Images\Square44x44Logo.png">
|
||||||
<uap:DefaultTile Wide310x150Logo="Images\Wide310x150Logo.png" Square71x71Logo="Images\SmallTile.png" Square310x310Logo="Images\LargeTile.png"/>
|
<uap:DefaultTile Wide310x150Logo="Images\Wide310x150Logo.png" Square71x71Logo="Images\SmallTile.png" Square310x310Logo="Images\LargeTile.png"/>
|
||||||
<uap:SplashScreen Image="Images\SplashScreen.png" />
|
<uap:SplashScreen Image="Images\SplashScreen.png" uap5:Optional="true" />
|
||||||
</uap:VisualElements>
|
</uap:VisualElements>
|
||||||
|
|
||||||
<Extensions>
|
<Extensions>
|
||||||
|
|||||||
@@ -219,7 +219,20 @@ namespace Wino.Server
|
|||||||
{ MessageConstants.MessageDataTypeKey, message.GetType().Name }
|
{ MessageConstants.MessageDataTypeKey, message.GetType().Name }
|
||||||
};
|
};
|
||||||
|
|
||||||
await connection.SendMessageAsync(set);
|
try
|
||||||
|
{
|
||||||
|
await connection.SendMessageAsync(set);
|
||||||
|
}
|
||||||
|
catch (InvalidOperationException)
|
||||||
|
{
|
||||||
|
// Connection might've been disposed during the SendMessageAsync call.
|
||||||
|
// This is a safe way to handle the exception.
|
||||||
|
// We don't lock the connection since this request may take sometime to complete.
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
Log.Error(exception, "SendMessageAsync threw an exception");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnConnectionClosed(AppServiceConnection sender, AppServiceClosedEventArgs args)
|
private void OnConnectionClosed(AppServiceConnection sender, AppServiceClosedEventArgs args)
|
||||||
|
|||||||
Reference in New Issue
Block a user