Adding iCloud and Yahoo as special IMAP handling scenario.
This commit is contained in:
@@ -1,16 +0,0 @@
|
|||||||
using Wino.Core.Domain.Enums;
|
|
||||||
using Wino.Core.Domain.Interfaces;
|
|
||||||
|
|
||||||
namespace Wino.Authentication
|
|
||||||
{
|
|
||||||
public class Office365Authenticator : OutlookAuthenticator
|
|
||||||
{
|
|
||||||
public Office365Authenticator(INativeAppService nativeAppService,
|
|
||||||
IApplicationConfiguration applicationConfiguration,
|
|
||||||
IAuthenticatorConfig authenticatorConfig) : base(nativeAppService, applicationConfiguration, authenticatorConfig)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override MailProviderType ProviderType => MailProviderType.Office365;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -27,7 +27,7 @@ namespace Wino.Calendar.Services
|
|||||||
|
|
||||||
foreach (var type in providers)
|
foreach (var type in providers)
|
||||||
{
|
{
|
||||||
providerList.Add(new ProviderDetail(type));
|
providerList.Add(new ProviderDetail(type, SpecialImapProvider.None));
|
||||||
}
|
}
|
||||||
|
|
||||||
return providerList;
|
return providerList;
|
||||||
|
|||||||
@@ -72,6 +72,12 @@ namespace Wino.Core.Domain.Entities.Shared
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid? MergedInboxId { get; set; }
|
public Guid? MergedInboxId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the additional IMAP provider assignment for the account.
|
||||||
|
/// Providers that use IMAP as a synchronizer but have special requirements.
|
||||||
|
/// </summary>
|
||||||
|
public SpecialImapProvider SpecialImapProvider { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Contains the merged inbox this account belongs to.
|
/// Contains the merged inbox this account belongs to.
|
||||||
/// Ignored for all SQLite operations.
|
/// Ignored for all SQLite operations.
|
||||||
@@ -95,7 +101,7 @@ namespace Wino.Core.Domain.Entities.Shared
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets whether the account can perform ProfileInformation sync type.
|
/// Gets whether the account can perform ProfileInformation sync type.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsProfileInfoSyncSupported => ProviderType == MailProviderType.Outlook || ProviderType == MailProviderType.Office365 || ProviderType == MailProviderType.Gmail;
|
public bool IsProfileInfoSyncSupported => ProviderType == MailProviderType.Outlook || ProviderType == MailProviderType.Gmail;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets whether the account can perform AliasInformation sync type.
|
/// Gets whether the account can perform AliasInformation sync type.
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
{
|
{
|
||||||
Outlook,
|
Outlook,
|
||||||
Gmail,
|
Gmail,
|
||||||
Office365,
|
IMAP4 = 4 // 2-3 were removed after release. Don't change for backward compatibility.
|
||||||
Yahoo,
|
|
||||||
IMAP4
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
9
Wino.Core.Domain/Enums/SpecialImapProvider.cs
Normal file
9
Wino.Core.Domain/Enums/SpecialImapProvider.cs
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
namespace Wino.Core.Domain.Enums
|
||||||
|
{
|
||||||
|
public enum SpecialImapProvider
|
||||||
|
{
|
||||||
|
None,
|
||||||
|
iCloud,
|
||||||
|
Yahoo
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@ namespace Wino.Core.Domain.Interfaces
|
|||||||
public interface IProviderDetail
|
public interface IProviderDetail
|
||||||
{
|
{
|
||||||
MailProviderType Type { get; }
|
MailProviderType Type { get; }
|
||||||
|
SpecialImapProvider SpecialImapProvider { get; }
|
||||||
string Name { get; }
|
string Name { get; }
|
||||||
string Description { get; }
|
string Description { get; }
|
||||||
string ProviderImage { get; }
|
string ProviderImage { get; }
|
||||||
|
|||||||
@@ -6,18 +6,32 @@ namespace Wino.Core.Domain.Models.Accounts
|
|||||||
public class ProviderDetail : IProviderDetail
|
public class ProviderDetail : IProviderDetail
|
||||||
{
|
{
|
||||||
public MailProviderType Type { get; }
|
public MailProviderType Type { get; }
|
||||||
|
public SpecialImapProvider SpecialImapProvider { get; }
|
||||||
public string Name { get; }
|
public string Name { get; }
|
||||||
|
|
||||||
public string Description { get; }
|
public string Description { get; }
|
||||||
|
|
||||||
public string ProviderImage => $"ms-appx:///Wino.Core.UWP/Assets/Providers/{Type}.png";
|
public string ProviderImage
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (SpecialImapProvider == SpecialImapProvider.None)
|
||||||
|
{
|
||||||
|
return $"ms-appx:///Wino.Core.UWP/Assets/Providers/{Type}.png";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return $"ms-appx:///Wino.Core.UWP/Assets/Providers/{SpecialImapProvider}.png";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public bool IsSupported => Type == MailProviderType.Outlook || Type == MailProviderType.Gmail || Type == MailProviderType.IMAP4;
|
public bool IsSupported => Type == MailProviderType.Outlook || Type == MailProviderType.Gmail || Type == MailProviderType.IMAP4;
|
||||||
|
|
||||||
public ProviderDetail(MailProviderType type)
|
public ProviderDetail(MailProviderType type, SpecialImapProvider specialImapProvider)
|
||||||
{
|
{
|
||||||
Type = type;
|
Type = type;
|
||||||
|
SpecialImapProvider = specialImapProvider;
|
||||||
|
|
||||||
switch (Type)
|
switch (Type)
|
||||||
{
|
{
|
||||||
@@ -25,21 +39,29 @@ namespace Wino.Core.Domain.Models.Accounts
|
|||||||
Name = "Outlook";
|
Name = "Outlook";
|
||||||
Description = "Outlook.com, Live.com, Hotmail, MSN";
|
Description = "Outlook.com, Live.com, Hotmail, MSN";
|
||||||
break;
|
break;
|
||||||
case MailProviderType.Office365:
|
|
||||||
Name = "Office 365";
|
|
||||||
Description = "Office 365, Exchange";
|
|
||||||
break;
|
|
||||||
case MailProviderType.Gmail:
|
case MailProviderType.Gmail:
|
||||||
Name = "Gmail";
|
Name = "Gmail";
|
||||||
Description = Translator.ProviderDetail_Gmail_Description;
|
Description = Translator.ProviderDetail_Gmail_Description;
|
||||||
break;
|
break;
|
||||||
case MailProviderType.Yahoo:
|
|
||||||
Name = "Yahoo";
|
|
||||||
Description = "Yahoo Mail";
|
|
||||||
break;
|
|
||||||
case MailProviderType.IMAP4:
|
case MailProviderType.IMAP4:
|
||||||
Name = Translator.ProviderDetail_IMAP_Title;
|
switch (specialImapProvider)
|
||||||
Description = Translator.ProviderDetail_IMAP_Description;
|
{
|
||||||
|
case SpecialImapProvider.None:
|
||||||
|
Name = Translator.ProviderDetail_IMAP_Title;
|
||||||
|
Description = Translator.ProviderDetail_IMAP_Description;
|
||||||
|
break;
|
||||||
|
case SpecialImapProvider.iCloud:
|
||||||
|
Name = Translator.ProviderDetail_iCloud_Title;
|
||||||
|
Description = Translator.ProviderDetail_iCloud_Description;
|
||||||
|
break;
|
||||||
|
case SpecialImapProvider.Yahoo:
|
||||||
|
Name = Translator.ProviderDetail_Yahoo_Title;
|
||||||
|
Description = Translator.ProviderDetail_Yahoo_Description;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -401,6 +401,10 @@
|
|||||||
"ProviderDetail_Gmail_Description": "Google Account",
|
"ProviderDetail_Gmail_Description": "Google Account",
|
||||||
"ProviderDetail_IMAP_Description": "Custom IMAP/SMTP server",
|
"ProviderDetail_IMAP_Description": "Custom IMAP/SMTP server",
|
||||||
"ProviderDetail_IMAP_Title": "IMAP Server",
|
"ProviderDetail_IMAP_Title": "IMAP Server",
|
||||||
|
"ProviderDetail_Yahoo_Title": "Yahoo Mail",
|
||||||
|
"ProviderDetail_Yahoo_Description": "Yahoo Account",
|
||||||
|
"ProviderDetail_iCloud_Title": "iCloud",
|
||||||
|
"ProviderDetail_iCloud_Description": "Apple iCloud Account",
|
||||||
"ProtocolLogAvailable_Message": "Protocol logs are available for diagnostics.",
|
"ProtocolLogAvailable_Message": "Protocol logs are available for diagnostics.",
|
||||||
"Results": "Results",
|
"Results": "Results",
|
||||||
"Right": "Right",
|
"Right": "Right",
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 4.6 KiB |
BIN
Wino.Core.UWP/Assets/Providers/iCloud.png
Normal file
BIN
Wino.Core.UWP/Assets/Providers/iCloud.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
Binary file not shown.
@@ -98,6 +98,8 @@ namespace Wino.Core.UWP.Controls
|
|||||||
{ WinoIconGlyph.EventRespond, "\uE924" },
|
{ WinoIconGlyph.EventRespond, "\uE924" },
|
||||||
{ WinoIconGlyph.EventReminder, "\uE923" },
|
{ WinoIconGlyph.EventReminder, "\uE923" },
|
||||||
{ WinoIconGlyph.EventJoinOnline, "\uE926" },
|
{ WinoIconGlyph.EventJoinOnline, "\uE926" },
|
||||||
|
{ WinoIconGlyph.Yahoo, "\uE92B" },
|
||||||
|
{ WinoIconGlyph.Apple, "\uE92C" },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,6 +99,8 @@ namespace Wino.Core.UWP.Controls
|
|||||||
EventReminder,
|
EventReminder,
|
||||||
EventEditSeries,
|
EventEditSeries,
|
||||||
EventJoinOnline,
|
EventJoinOnline,
|
||||||
|
Apple,
|
||||||
|
Yahoo
|
||||||
}
|
}
|
||||||
|
|
||||||
public class WinoFontIcon : FontIcon
|
public class WinoFontIcon : FontIcon
|
||||||
|
|||||||
@@ -43,38 +43,83 @@
|
|||||||
</ContentDialog.Resources>
|
</ContentDialog.Resources>
|
||||||
|
|
||||||
<Grid MinWidth="400" RowSpacing="12">
|
<Grid MinWidth="400" RowSpacing="12">
|
||||||
<Grid.RowDefinitions>
|
<Grid Visibility="{x:Bind IsProviderSelectionVisible, Mode=OneWay}">
|
||||||
<RowDefinition Height="Auto" />
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="Auto" />
|
||||||
</Grid.RowDefinitions>
|
<RowDefinition Height="*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<!-- Account Name -->
|
<!-- Account Name -->
|
||||||
<TextBox
|
<TextBox
|
||||||
x:Name="AccountNameTextbox"
|
x:Name="AccountNameTextbox"
|
||||||
Header="{x:Bind domain:Translator.NewAccountDialog_AccountName}"
|
Header="{x:Bind domain:Translator.NewAccountDialog_AccountName}"
|
||||||
PlaceholderText="{x:Bind domain:Translator.NewAccountDialog_AccountNamePlaceholder}"
|
PlaceholderText="{x:Bind domain:Translator.NewAccountDialog_AccountNamePlaceholder}"
|
||||||
TextChanged="AccountNameChanged" />
|
TextChanged="InputChanged" />
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
TODO: Move Name, Sender Name and Color Picker to another Frame.
|
TODO: Move Name, Sender Name and Color Picker to another Frame.
|
||||||
Provider selection should be first, then account details.
|
Provider selection should be first, then account details.
|
||||||
-->
|
-->
|
||||||
<!--<Grid Grid.Row="1">
|
<!--<Grid Grid.Row="1">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<TextBlock Text="Color" />
|
<TextBlock Text="Color" />
|
||||||
<muxc:ColorPicker x:Name="AccountColorPicker" Grid.Column="1" />
|
<muxc:ColorPicker x:Name="AccountColorPicker" Grid.Column="1" />
|
||||||
</Grid>-->
|
</Grid>-->
|
||||||
|
|
||||||
<ListView
|
<ListView
|
||||||
Grid.Row="2"
|
Grid.Row="2"
|
||||||
Padding="0"
|
Padding="0"
|
||||||
ItemTemplate="{StaticResource NewMailProviderTemplate}"
|
ItemTemplate="{StaticResource NewMailProviderTemplate}"
|
||||||
ItemsSource="{x:Bind Providers}"
|
ItemsSource="{x:Bind Providers}"
|
||||||
SelectedItem="{x:Bind SelectedMailProvider, Mode=TwoWay}"
|
SelectedItem="{x:Bind SelectedMailProvider, Mode=TwoWay}"
|
||||||
SelectionMode="Single" />
|
SelectionMode="Single" />
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<!-- Known special IMAP login details. -->
|
||||||
|
<Grid RowSpacing="12" Visibility="{x:Bind IsSpecialImapServerPartVisible, Mode=OneWay}">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<Button Click="BackClicked">
|
||||||
|
<Button.Content>
|
||||||
|
<Viewbox Width="16">
|
||||||
|
<PathIcon Data="F1 M 20 9.375 C 20 9.544271 19.93815 9.690756 19.814453 9.814453 C 19.690754 9.938151 19.54427 10 19.375 10 L 2.138672 10 L 9.814453 17.685547 C 9.93815 17.809244 10 17.955729 10 18.125 C 10 18.294271 9.93815 18.440756 9.814453 18.564453 C 9.690755 18.68815 9.544271 18.75 9.375 18.75 C 9.205729 18.75 9.059244 18.68815 8.935547 18.564453 L 0.214844 9.84375 C 0.143229 9.772136 0.089518 9.700521 0.053711 9.628906 C 0.017904 9.557292 0 9.472656 0 9.375 C 0 9.277344 0.017904 9.192709 0.053711 9.121094 C 0.089518 9.049479 0.143229 8.977865 0.214844 8.90625 L 8.935547 0.185547 C 9.059244 0.06185 9.205729 0 9.375 0 C 9.544271 0 9.690755 0.06185 9.814453 0.185547 C 9.93815 0.309246 10 0.45573 10 0.625 C 10 0.794271 9.93815 0.940756 9.814453 1.064453 L 2.138672 8.75 L 19.375 8.75 C 19.54427 8.75 19.690754 8.81185 19.814453 8.935547 C 19.93815 9.059245 20 9.205729 20 9.375 Z " />
|
||||||
|
</Viewbox>
|
||||||
|
</Button.Content>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Image
|
||||||
|
Width="150"
|
||||||
|
Height="50"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
Source="{x:Bind SelectedMailProvider.ProviderImage, Mode=OneWay}" />
|
||||||
|
|
||||||
|
<TextBox
|
||||||
|
x:Name="SpecialImapAddress"
|
||||||
|
Grid.Row="1"
|
||||||
|
TextChanged="InputChanged"
|
||||||
|
Header="E-mail Address"
|
||||||
|
PlaceholderText="eg. johndoe@testmail.com" />
|
||||||
|
|
||||||
|
<PasswordBox
|
||||||
|
x:Name="AppSpecificPassword"
|
||||||
|
PasswordChanged="ImapPasswordChanged"
|
||||||
|
Grid.Row="2"
|
||||||
|
Header="App-Specific Password" />
|
||||||
|
|
||||||
|
<HyperlinkButton
|
||||||
|
Grid.Row="3"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Click="AppSpecificHelpButtonClicked"
|
||||||
|
Content="How do I get app-specific password?" />
|
||||||
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</ContentDialog>
|
</ContentDialog>
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
using System.Collections.Generic;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Windows.System;
|
||||||
using Windows.UI.Xaml;
|
using Windows.UI.Xaml;
|
||||||
using Windows.UI.Xaml.Controls;
|
using Windows.UI.Xaml.Controls;
|
||||||
|
using Wino.Core.Domain.Enums;
|
||||||
using Wino.Core.Domain.Interfaces;
|
using Wino.Core.Domain.Interfaces;
|
||||||
using Wino.Core.Domain.Models.Accounts;
|
using Wino.Core.Domain.Models.Accounts;
|
||||||
|
|
||||||
@@ -8,6 +11,16 @@ namespace Wino.Core.UWP.Dialogs
|
|||||||
{
|
{
|
||||||
public sealed partial class NewAccountDialog : ContentDialog
|
public sealed partial class NewAccountDialog : ContentDialog
|
||||||
{
|
{
|
||||||
|
private Dictionary<SpecialImapProvider, string> helpingLinks = new Dictionary<SpecialImapProvider, string>()
|
||||||
|
{
|
||||||
|
{ SpecialImapProvider.iCloud, "https://support.apple.com/en-us/102654" },
|
||||||
|
{ SpecialImapProvider.Yahoo, "http://help.yahoo.com/kb/SLN15241.html" },
|
||||||
|
};
|
||||||
|
|
||||||
|
public static readonly DependencyProperty IsProviderSelectionVisibleProperty = DependencyProperty.Register(nameof(IsProviderSelectionVisible), typeof(bool), typeof(NewAccountDialog), new PropertyMetadata(true));
|
||||||
|
public static readonly DependencyProperty IsSpecialImapServerPartVisibleProperty = DependencyProperty.Register(nameof(IsSpecialImapServerPartVisible), typeof(bool), typeof(NewAccountDialog), new PropertyMetadata(false));
|
||||||
|
public static readonly DependencyProperty SelectedMailProviderProperty = DependencyProperty.Register(nameof(SelectedMailProvider), typeof(ProviderDetail), typeof(NewAccountDialog), new PropertyMetadata(null, new PropertyChangedCallback(OnSelectedProviderChanged)));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets current selected mail provider in the dialog.
|
/// Gets or sets current selected mail provider in the dialog.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -17,7 +30,18 @@ namespace Wino.Core.UWP.Dialogs
|
|||||||
set { SetValue(SelectedMailProviderProperty, value); }
|
set { SetValue(SelectedMailProviderProperty, value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public static readonly DependencyProperty SelectedMailProviderProperty = DependencyProperty.Register(nameof(SelectedMailProvider), typeof(ProviderDetail), typeof(NewAccountDialog), new PropertyMetadata(null, new PropertyChangedCallback(OnSelectedProviderChanged)));
|
|
||||||
|
public bool IsProviderSelectionVisible
|
||||||
|
{
|
||||||
|
get { return (bool)GetValue(IsProviderSelectionVisibleProperty); }
|
||||||
|
set { SetValue(IsProviderSelectionVisibleProperty, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsSpecialImapServerPartVisible
|
||||||
|
{
|
||||||
|
get { return (bool)GetValue(IsSpecialImapServerPartVisibleProperty); }
|
||||||
|
set { SetValue(IsSpecialImapServerPartVisibleProperty, value); }
|
||||||
|
}
|
||||||
|
|
||||||
// List of available mail providers for now.
|
// List of available mail providers for now.
|
||||||
|
|
||||||
@@ -49,12 +73,25 @@ namespace Wino.Core.UWP.Dialogs
|
|||||||
|
|
||||||
if (IsSecondaryButtonEnabled)
|
if (IsSecondaryButtonEnabled)
|
||||||
{
|
{
|
||||||
Result = new AccountCreationDialogResult(SelectedMailProvider.Type, AccountNameTextbox.Text.Trim());
|
if (SelectedMailProvider.SpecialImapProvider != SpecialImapProvider.None)
|
||||||
Hide();
|
{
|
||||||
|
// This step requires app-sepcific password login for some providers.
|
||||||
|
args.Cancel = true;
|
||||||
|
|
||||||
|
IsProviderSelectionVisible = false;
|
||||||
|
IsSpecialImapServerPartVisible = true;
|
||||||
|
|
||||||
|
Validate();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Result = new AccountCreationDialogResult(SelectedMailProvider.Type, AccountNameTextbox.Text.Trim());
|
||||||
|
Hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AccountNameChanged(object sender, TextChangedEventArgs e) => Validate();
|
private void InputChanged(object sender, TextChangedEventArgs e) => Validate();
|
||||||
private void SenderNameChanged(object sender, TextChangedEventArgs e) => Validate();
|
private void SenderNameChanged(object sender, TextChangedEventArgs e) => Validate();
|
||||||
|
|
||||||
private void Validate()
|
private void Validate()
|
||||||
@@ -68,7 +105,8 @@ namespace Wino.Core.UWP.Dialogs
|
|||||||
{
|
{
|
||||||
bool shouldEnable = SelectedMailProvider != null
|
bool shouldEnable = SelectedMailProvider != null
|
||||||
&& SelectedMailProvider.IsSupported
|
&& SelectedMailProvider.IsSupported
|
||||||
&& !string.IsNullOrEmpty(AccountNameTextbox.Text);
|
&& !string.IsNullOrEmpty(AccountNameTextbox.Text)
|
||||||
|
&& (IsSpecialImapServerPartVisible ? (!string.IsNullOrEmpty(AppSpecificPassword.Password) && EmailValidation.EmailValidator.Validate(SpecialImapAddress.Text)) : true);
|
||||||
|
|
||||||
IsPrimaryButtonEnabled = shouldEnable;
|
IsPrimaryButtonEnabled = shouldEnable;
|
||||||
}
|
}
|
||||||
@@ -79,5 +117,22 @@ namespace Wino.Core.UWP.Dialogs
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void DialogOpened(ContentDialog sender, ContentDialogOpenedEventArgs args) => Validate();
|
private void DialogOpened(ContentDialog sender, ContentDialogOpenedEventArgs args) => Validate();
|
||||||
|
|
||||||
|
private void BackClicked(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
IsSpecialImapServerPartVisible = false;
|
||||||
|
IsProviderSelectionVisible = true;
|
||||||
|
|
||||||
|
Validate();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ImapPasswordChanged(object sender, RoutedEventArgs e) => Validate();
|
||||||
|
|
||||||
|
private async void AppSpecificHelpButtonClicked(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
var helpUrl = helpingLinks[SelectedMailProvider.SpecialImapProvider];
|
||||||
|
|
||||||
|
await Launcher.LaunchUriAsync(new Uri(helpUrl));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ using Windows.UI.Xaml.Controls.Primitives;
|
|||||||
using Windows.UI.Xaml.Markup;
|
using Windows.UI.Xaml.Markup;
|
||||||
using Windows.UI.Xaml.Media;
|
using Windows.UI.Xaml.Media;
|
||||||
using Wino.Core.Domain;
|
using Wino.Core.Domain;
|
||||||
|
using Wino.Core.Domain.Entities.Shared;
|
||||||
using Wino.Core.Domain.Enums;
|
using Wino.Core.Domain.Enums;
|
||||||
using Wino.Core.Domain.Models.MailItem;
|
using Wino.Core.Domain.Models.MailItem;
|
||||||
using Wino.Core.UWP.Controls;
|
using Wino.Core.UWP.Controls;
|
||||||
@@ -261,17 +262,31 @@ namespace Wino.Helpers
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static WinoIconGlyph GetProviderIcon(MailProviderType providerType)
|
|
||||||
|
public static WinoIconGlyph GetProviderIcon(MailProviderType providerType, SpecialImapProvider specialImapProvider)
|
||||||
{
|
{
|
||||||
return providerType switch
|
if (specialImapProvider == SpecialImapProvider.None)
|
||||||
{
|
{
|
||||||
MailProviderType.Outlook => WinoIconGlyph.Microsoft,
|
return providerType switch
|
||||||
MailProviderType.Gmail => WinoIconGlyph.Google,
|
{
|
||||||
MailProviderType.Office365 => WinoIconGlyph.Microsoft,
|
MailProviderType.Outlook => WinoIconGlyph.Microsoft,
|
||||||
MailProviderType.IMAP4 => WinoIconGlyph.IMAP,
|
MailProviderType.Gmail => WinoIconGlyph.Google,
|
||||||
_ => WinoIconGlyph.None,
|
MailProviderType.IMAP4 => WinoIconGlyph.IMAP,
|
||||||
};
|
_ => WinoIconGlyph.None,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return specialImapProvider switch
|
||||||
|
{
|
||||||
|
SpecialImapProvider.iCloud => WinoIconGlyph.Apple,
|
||||||
|
SpecialImapProvider.Yahoo => WinoIconGlyph.Yahoo,
|
||||||
|
_ => WinoIconGlyph.None,
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
public static WinoIconGlyph GetProviderIcon(MailAccount account)
|
||||||
|
=> GetProviderIcon(account.ProviderType, account.SpecialImapProvider);
|
||||||
|
|
||||||
public static Geometry GetPathGeometry(string pathMarkup)
|
public static Geometry GetPathGeometry(string pathMarkup)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
Header="{x:Bind Account.Name}"
|
Header="{x:Bind Account.Name}"
|
||||||
IsClickEnabled="True">
|
IsClickEnabled="True">
|
||||||
<winuiControls:SettingsCard.HeaderIcon>
|
<winuiControls:SettingsCard.HeaderIcon>
|
||||||
<coreControls:WinoFontIcon FontSize="64" Icon="{x:Bind helpers:XamlHelpers.GetProviderIcon(ProviderDetail.Type)}" />
|
<coreControls:WinoFontIcon FontSize="64" Icon="{x:Bind helpers:XamlHelpers.GetProviderIcon(Account)}" />
|
||||||
</winuiControls:SettingsCard.HeaderIcon>
|
</winuiControls:SettingsCard.HeaderIcon>
|
||||||
</winuiControls:SettingsCard>
|
</winuiControls:SettingsCard>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
|||||||
@@ -215,6 +215,9 @@
|
|||||||
<PackageReference Include="CommunityToolkit.Uwp.Controls.TabbedCommandBar">
|
<PackageReference Include="CommunityToolkit.Uwp.Controls.TabbedCommandBar">
|
||||||
<Version>8.1.240916</Version>
|
<Version>8.1.240916</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
<PackageReference Include="EmailValidation">
|
||||||
|
<Version>1.2.0</Version>
|
||||||
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.AppCenter.Analytics">
|
<PackageReference Include="Microsoft.AppCenter.Analytics">
|
||||||
<Version>5.0.6</Version>
|
<Version>5.0.6</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
@@ -262,6 +265,7 @@
|
|||||||
</SDKReference>
|
</SDKReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Content Include="Assets\Providers\iCloud.png" />
|
||||||
<Content Include="Assets\WinoIcons.ttf" />
|
<Content Include="Assets\WinoIcons.ttf" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ namespace Wino.Core.Services
|
|||||||
return providerType switch
|
return providerType switch
|
||||||
{
|
{
|
||||||
MailProviderType.Outlook => new OutlookAuthenticator(_nativeAppService, _applicationConfiguration, _authenticatorConfig),
|
MailProviderType.Outlook => new OutlookAuthenticator(_nativeAppService, _applicationConfiguration, _authenticatorConfig),
|
||||||
MailProviderType.Office365 => new Office365Authenticator(_nativeAppService, _applicationConfiguration, _authenticatorConfig),
|
|
||||||
MailProviderType.Gmail => new GmailAuthenticator(_authenticatorConfig),
|
MailProviderType.Gmail => new GmailAuthenticator(_authenticatorConfig),
|
||||||
_ => throw new ArgumentException(Translator.Exception_UnsupportedProvider),
|
_ => throw new ArgumentException(Translator.Exception_UnsupportedProvider),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -69,7 +69,6 @@ namespace Wino.Core.Services
|
|||||||
switch (providerType)
|
switch (providerType)
|
||||||
{
|
{
|
||||||
case Domain.Enums.MailProviderType.Outlook:
|
case Domain.Enums.MailProviderType.Outlook:
|
||||||
case Domain.Enums.MailProviderType.Office365:
|
|
||||||
return new OutlookSynchronizer(mailAccount, _outlookAuthenticator, _outlookChangeProcessor);
|
return new OutlookSynchronizer(mailAccount, _outlookAuthenticator, _outlookChangeProcessor);
|
||||||
case Domain.Enums.MailProviderType.Gmail:
|
case Domain.Enums.MailProviderType.Gmail:
|
||||||
return new GmailSynchronizer(mailAccount, _gmailAuthenticator, _gmailChangeProcessor);
|
return new GmailSynchronizer(mailAccount, _gmailAuthenticator, _gmailChangeProcessor);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ namespace Wino.Core.Services
|
|||||||
{
|
{
|
||||||
return mailProviderType switch
|
return mailProviderType switch
|
||||||
{
|
{
|
||||||
MailProviderType.Outlook or MailProviderType.Office365 => _outlookThreadingStrategy,
|
MailProviderType.Outlook => _outlookThreadingStrategy,
|
||||||
MailProviderType.Gmail => _gmailThreadingStrategy,
|
MailProviderType.Gmail => _gmailThreadingStrategy,
|
||||||
_ => _imapThreadStrategy,
|
_ => _imapThreadStrategy,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -163,8 +163,7 @@ namespace Wino.Core.Services
|
|||||||
MailItemFolder archiveFolder = null;
|
MailItemFolder archiveFolder = null;
|
||||||
|
|
||||||
bool shouldRequireArchiveFolder = mailItem.AssignedAccount.ProviderType == MailProviderType.Outlook
|
bool shouldRequireArchiveFolder = mailItem.AssignedAccount.ProviderType == MailProviderType.Outlook
|
||||||
|| mailItem.AssignedAccount.ProviderType == MailProviderType.IMAP4
|
|| mailItem.AssignedAccount.ProviderType == MailProviderType.IMAP4;
|
||||||
|| mailItem.AssignedAccount.ProviderType == MailProviderType.Office365;
|
|
||||||
|
|
||||||
if (shouldRequireArchiveFolder)
|
if (shouldRequireArchiveFolder)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ namespace Wino.Core.Synchronizers
|
|||||||
// message will not appear in user's inbox since it's not in the Sent Items folder.
|
// message will not appear in user's inbox since it's not in the Sent Items folder.
|
||||||
|
|
||||||
shouldDelayExecution =
|
shouldDelayExecution =
|
||||||
(Account.ProviderType == MailProviderType.Outlook || Account.ProviderType == MailProviderType.Office365)
|
(Account.ProviderType == MailProviderType.Outlook)
|
||||||
&& requestCopies.Any(a => a.ResynchronizationDelay > 0);
|
&& requestCopies.Any(a => a.ResynchronizationDelay > 0);
|
||||||
|
|
||||||
if (shouldDelayExecution)
|
if (shouldDelayExecution)
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
</TransitionCollection>
|
</TransitionCollection>
|
||||||
</coreControls:WinoNavigationViewItem.ContentTransitions>
|
</coreControls:WinoNavigationViewItem.ContentTransitions>
|
||||||
<muxc:NavigationViewItem.Icon>
|
<muxc:NavigationViewItem.Icon>
|
||||||
<coreControls:WinoFontIcon FontSize="12" Icon="{x:Bind helpers:XamlHelpers.GetProviderIcon(Parameter.ProviderType)}" />
|
<coreControls:WinoFontIcon FontSize="12" Icon="{x:Bind helpers:XamlHelpers.GetProviderIcon(Parameter)}" />
|
||||||
</muxc:NavigationViewItem.Icon>
|
</muxc:NavigationViewItem.Icon>
|
||||||
<muxc:NavigationViewItem.InfoBadge>
|
<muxc:NavigationViewItem.InfoBadge>
|
||||||
<muxc:InfoBadge
|
<muxc:InfoBadge
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
Grid.RowSpan="2"
|
Grid.RowSpan="2"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
FontSize="24"
|
FontSize="24"
|
||||||
Icon="{x:Bind helpers:XamlHelpers.GetProviderIcon(ProviderDetail.Type)}" />
|
Icon="{x:Bind helpers:XamlHelpers.GetProviderIcon(ProviderDetail.Type, ProviderDetail.SpecialImapProvider)}" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
FontWeight="SemiBold"
|
FontWeight="SemiBold"
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Windows.UI.Xaml.Controls;
|
using Windows.UI.Xaml.Controls;
|
||||||
using Wino.Controls;
|
|
||||||
using Wino.Core.Domain.Entities.Shared;
|
using Wino.Core.Domain.Entities.Shared;
|
||||||
using Wino.Core.UWP.Controls;
|
using Wino.Core.UWP.Controls;
|
||||||
using Wino.Helpers;
|
using Wino.Helpers;
|
||||||
@@ -22,7 +21,7 @@ namespace Wino.MenuFlyouts
|
|||||||
|
|
||||||
foreach (var account in _accounts)
|
foreach (var account in _accounts)
|
||||||
{
|
{
|
||||||
var pathData = new WinoFontIcon() { Icon = XamlHelpers.GetProviderIcon(account.ProviderType) };
|
var pathData = new WinoFontIcon() { Icon = XamlHelpers.GetProviderIcon(account) };
|
||||||
var menuItem = new MenuFlyoutItem() { Tag = account.Address, Icon = pathData, Text = $"{account.Name} ({account.Address})", MinHeight = 55 };
|
var menuItem = new MenuFlyoutItem() { Tag = account.Address, Icon = pathData, Text = $"{account.Name} ({account.Address})", MinHeight = 55 };
|
||||||
|
|
||||||
menuItem.Click += AccountClicked;
|
menuItem.Click += AccountClicked;
|
||||||
|
|||||||
@@ -20,20 +20,15 @@ namespace Wino.Mail.Services
|
|||||||
|
|
||||||
public List<IProviderDetail> GetAvailableProviders()
|
public List<IProviderDetail> GetAvailableProviders()
|
||||||
{
|
{
|
||||||
var providerList = new List<IProviderDetail>();
|
var providerList = new List<IProviderDetail>
|
||||||
|
|
||||||
var providers = new MailProviderType[]
|
|
||||||
{
|
{
|
||||||
MailProviderType.Outlook,
|
new ProviderDetail(MailProviderType.Outlook, SpecialImapProvider.None),
|
||||||
MailProviderType.Gmail,
|
new ProviderDetail(MailProviderType.Gmail, SpecialImapProvider.None),
|
||||||
MailProviderType.IMAP4
|
new ProviderDetail(MailProviderType.IMAP4, SpecialImapProvider.iCloud),
|
||||||
|
new ProviderDetail(MailProviderType.IMAP4, SpecialImapProvider.Yahoo),
|
||||||
|
new ProviderDetail(MailProviderType.IMAP4, SpecialImapProvider.None)
|
||||||
};
|
};
|
||||||
|
|
||||||
foreach (var type in providers)
|
|
||||||
{
|
|
||||||
providerList.Add(new ProviderDetail(type));
|
|
||||||
}
|
|
||||||
|
|
||||||
return providerList;
|
return providerList;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
Header="{x:Bind Account.Name}"
|
Header="{x:Bind Account.Name}"
|
||||||
IsClickEnabled="True">
|
IsClickEnabled="True">
|
||||||
<controls:SettingsCard.HeaderIcon>
|
<controls:SettingsCard.HeaderIcon>
|
||||||
<coreControls:WinoFontIcon FontSize="64" Icon="{x:Bind helpers:XamlHelpers.GetProviderIcon(ProviderDetail.Type)}" />
|
<coreControls:WinoFontIcon FontSize="64" Icon="{x:Bind helpers:XamlHelpers.GetProviderIcon(Account)}" />
|
||||||
</controls:SettingsCard.HeaderIcon>
|
</controls:SettingsCard.HeaderIcon>
|
||||||
<controls:SettingsCard.ActionIcon>
|
<controls:SettingsCard.ActionIcon>
|
||||||
<PathIcon
|
<PathIcon
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
Header="{x:Bind Account.Name}"
|
Header="{x:Bind Account.Name}"
|
||||||
IsClickEnabled="True">
|
IsClickEnabled="True">
|
||||||
<controls:SettingsCard.HeaderIcon>
|
<controls:SettingsCard.HeaderIcon>
|
||||||
<coreControls:WinoFontIcon FontSize="64" Icon="{x:Bind helpers:XamlHelpers.GetProviderIcon(ProviderDetail.Type)}" />
|
<coreControls:WinoFontIcon FontSize="64" Icon="{x:Bind helpers:XamlHelpers.GetProviderIcon(Account)}" />
|
||||||
</controls:SettingsCard.HeaderIcon>
|
</controls:SettingsCard.HeaderIcon>
|
||||||
|
|
||||||
<controls:SettingsCard.ActionIcon>
|
<controls:SettingsCard.ActionIcon>
|
||||||
|
|||||||
@@ -502,7 +502,7 @@ namespace Wino.Services
|
|||||||
account.Preferences = preferences;
|
account.Preferences = preferences;
|
||||||
|
|
||||||
// Outlook & Office 365 supports Focused inbox. Enabled by default.
|
// Outlook & Office 365 supports Focused inbox. Enabled by default.
|
||||||
bool isMicrosoftProvider = account.ProviderType == MailProviderType.Outlook || account.ProviderType == MailProviderType.Office365;
|
bool isMicrosoftProvider = account.ProviderType == MailProviderType.Outlook;
|
||||||
|
|
||||||
// TODO: This should come from account settings API.
|
// TODO: This should come from account settings API.
|
||||||
// Wino doesn't have MailboxSettings yet.
|
// Wino doesn't have MailboxSettings yet.
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ namespace Wino.Services
|
|||||||
if (!string.IsNullOrEmpty(unstickyItem.ParentRemoteFolderId))
|
if (!string.IsNullOrEmpty(unstickyItem.ParentRemoteFolderId))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (account.ProviderType == MailProviderType.Outlook || account.ProviderType == MailProviderType.Office365)
|
else if (account.ProviderType == MailProviderType.Outlook)
|
||||||
{
|
{
|
||||||
bool belongsToExistingParent = await Connection
|
bool belongsToExistingParent = await Connection
|
||||||
.Table<MailItemFolder>()
|
.Table<MailItemFolder>()
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace Wino.Services
|
|||||||
{
|
{
|
||||||
return mailProviderType switch
|
return mailProviderType switch
|
||||||
{
|
{
|
||||||
MailProviderType.Outlook or MailProviderType.Office365 => _outlookThreadingStrategy,
|
MailProviderType.Outlook => _outlookThreadingStrategy,
|
||||||
MailProviderType.Gmail => _gmailThreadingStrategy,
|
MailProviderType.Gmail => _gmailThreadingStrategy,
|
||||||
_ => _imapThreadStrategy,
|
_ => _imapThreadStrategy,
|
||||||
};
|
};
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user