Consider also errors during account recognition and not hide "OtherAccount" items OUT-561
authorThomas
Fri, 07 Jun 2019 13:24:14 +0200
branchOUT-561
changeset 2660b2590c96e518
parent 2656 76c182909c63
child 2664 c8588860ae75
Consider also errors during account recognition and not hide "OtherAccount" items
CryptableMailItem.cs
ThisAddIn.cs
     1.1 --- a/CryptableMailItem.cs	Wed Jun 05 09:51:11 2019 +0200
     1.2 +++ b/CryptableMailItem.cs	Fri Jun 07 13:24:14 2019 +0200
     1.3 @@ -1134,8 +1134,7 @@
     1.4                               * messages, as saving with ActiveSync accounts tends to fail and then leads to "Save message?" dialogs
     1.5                               * popping up during shutdown of Outlook. (see OUT-216).
     1.6                               */
     1.7 -                            if ((accountType != Outlook.OlAccountType.olEas) &&
     1.8 -                                (accountType != Outlook.OlAccountType.olImap))
     1.9 +                            if (accountType == Outlook.OlAccountType.olExchange)
    1.10                              {
    1.11                                  Globals.ThisAddIn.CreatePEPCategories();
    1.12  
    1.13 @@ -1263,11 +1262,13 @@
    1.14                              if (processedMessage != null)
    1.15                              {
    1.16                                  // If message is Autoconsume, set property and save. Do not sync with server.
    1.17 -                                if (string.IsNullOrEmpty(processedMessage.AutoConsume) == false)                                   
    1.18 +                                if (string.IsNullOrEmpty(processedMessage.AutoConsume) == false)
    1.19                                  {
    1.20                                      Log.Verbose("ProcessAndGetRating: AutoConsume message processed.");
    1.21  
    1.22 -                                    if (accountType != Outlook.OlAccountType.olImap)
    1.23 +                                    // Add pEp internal category if necessary
    1.24 +                                    if ((accountType != Outlook.OlAccountType.olImap) &&
    1.25 +                                        (accountType != Outlook.OlAccountType.olOtherAccount))
    1.26                                      {
    1.27                                          this.internalMailItem.SetPEPProperty(MailItemExtensions.PEPProperty.AutoConsume, "yes");
    1.28                                          saveInternalMailItem = true;
     2.1 --- a/ThisAddIn.cs	Wed Jun 05 09:51:11 2019 +0200
     2.2 +++ b/ThisAddIn.cs	Fri Jun 07 13:24:14 2019 +0200
     2.3 @@ -2262,7 +2262,9 @@
     2.4                  {
     2.5                      account = accounts[i];
     2.6  
     2.7 -                    if (account != null)
     2.8 +                    if ((account != null) &&
     2.9 +                        (account.AccountType != Outlook.OlAccountType.olImap) &&
    2.10 +                        (account.AccountType != Outlook.OlAccountType.olOtherAccount))
    2.11                      {
    2.12                          if (this.SetInboxViewFilters(account, enable) == false)
    2.13                          {