Gmail - Archive/Unarchive (#582)
* Disable timer back sync for debug builds. * Archive / unarchive feature for Gmail. * Archive folder name override for Gmail. * Possible crash fix when the next item is being selected after a mail is removed. * Restore proper account selection after pin/unpin of folder. * Making sure that incorrect arcive folder id is not saved in Gmailsynchronizer due to migration.
This commit is contained in:
@@ -53,9 +53,19 @@ public class WinoRequestDelegator : IWinoRequestDelegator
|
||||
_dialogService.HandleSystemFolderConfigurationDialogAsync(unavailableSpecialFolderException.AccountId, _folderService);
|
||||
});
|
||||
}
|
||||
catch (InvalidMoveTargetException)
|
||||
catch (InvalidMoveTargetException invalidMoveTargetException)
|
||||
{
|
||||
_dialogService.InfoBarMessage(Translator.Info_InvalidMoveTargetTitle, Translator.Info_InvalidMoveTargetMessage, InfoBarMessageType.Warning);
|
||||
switch (invalidMoveTargetException.Reason)
|
||||
{
|
||||
case InvalidMoveTargetReason.NonMoveTarget:
|
||||
_dialogService.InfoBarMessage(Translator.Info_InvalidMoveTargetTitle, Translator.Info_InvalidMoveTargetMessage, InfoBarMessageType.Warning);
|
||||
break;
|
||||
case InvalidMoveTargetReason.MultipleAccounts:
|
||||
_dialogService.InfoBarMessage(Translator.Info_InvalidMoveTargetTitle, Translator.Exception_InvalidMultiAccountMoveTarget, InfoBarMessageType.Warning);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (NotImplementedException)
|
||||
{
|
||||
|
||||
@@ -75,8 +75,13 @@ public class WinoRequestProcessor : IWinoRequestProcessor
|
||||
|
||||
if (action == MailOperation.Move && moveTargetStructure == null)
|
||||
{
|
||||
// TODO: Handle multiple accounts for move operation.
|
||||
// What happens if we move 2 different mails from 2 different accounts?
|
||||
// Handle the case when user is trying to move multiple mails that belong to different accounts.
|
||||
// We can't handle this with only 1 picker dialog.
|
||||
|
||||
bool isInvalidMoveTarget = preperationRequest.MailItems.Select(a => a.AssignedAccount.Id).Distinct().Count() > 1;
|
||||
|
||||
if (isInvalidMoveTarget)
|
||||
throw new InvalidMoveTargetException(InvalidMoveTargetReason.MultipleAccounts);
|
||||
|
||||
var accountId = preperationRequest.MailItems.FirstOrDefault().AssignedAccount.Id;
|
||||
|
||||
@@ -142,7 +147,7 @@ public class WinoRequestProcessor : IWinoRequestProcessor
|
||||
else if (action == MailOperation.Move)
|
||||
{
|
||||
if (moveTargetStructure == null)
|
||||
throw new InvalidMoveTargetException();
|
||||
throw new InvalidMoveTargetException(InvalidMoveTargetReason.NonMoveTarget);
|
||||
|
||||
// TODO
|
||||
// Rule: You can't move items to non-move target folders;
|
||||
|
||||
Reference in New Issue
Block a user