Some rearrangement and wording
authorThomas
Thu, 19 Apr 2018 09:29:31 +0200
changeset 212520a02601c453
parent 2123 476a71447ce6
child 2126 87415c86d813
Some rearrangement and wording
DecryptionStack.cs
UI/HandshakeDialog.xaml.cs
     1.1 --- a/DecryptionStack.cs	Tue Apr 17 15:47:29 2018 +0200
     1.2 +++ b/DecryptionStack.cs	Thu Apr 19 09:29:31 2018 +0200
     1.3 @@ -252,30 +252,34 @@
     1.4                      if (omi.GetIsForcefullyProtected())
     1.5                      {
     1.6                          Log.Verbose("DecryptionStack.DecryptionTimer_Tick: Force Protection Protocol Message found. Processing...");
     1.7 -
     1.8 -                        // OUT-418. Transport mails download state is HeaderOnly(no attachments), MarkForDownload causes Outlook crashes.
     1.9 -                        // As workaround: Create a copy of transport FP mail which makes Outlook download attachments and pass this copy to FPPMessage constructor.  
    1.10 -                         
    1.11 -                        Outlook.MailItem omiCopy= null;
    1.12 -                        if (Globals.GetOutlookVersion() == Globals.Version.Outlook2010 && omi.GetIsInIMAPStore() &&
    1.13 -                            !copiedFPP.Contains(omi.EntryID) && omi.GetIsAutoConsume())
    1.14 +                     
    1.15 +                        /* In Outlook 2010, mails may arrive with download state OlHeaderOnly, which means we have no attachments at this point.
    1.16 +                         * Setting the MarkForDownload can lead to Outlook crashing. Therefore, the workaround here is to create a copy of
    1.17 +                         * the mail item, which makes Outlook download the full item.
    1.18 +                         */ 
    1.19 +                        Outlook.MailItem omiCopy = null;
    1.20 +                        if ((Globals.GetOutlookVersion() == Globals.Version.Outlook2010) && 
    1.21 +                            (omi.GetIsInIMAPStore()) &&
    1.22 +                            (copiedFPP.Contains(omi.EntryID) == false) && 
    1.23 +                            (omi.GetIsAutoConsume()))
    1.24                          {
    1.25                              try
    1.26                              {
    1.27                                  omiCopy = omi.Copy();
    1.28 -                                object yesAutoConsume = "yes";
    1.29 -                                omiCopy.SetPEPProperty(MailItemExtensions.PEPProperty.AutoConsume, yesAutoConsume);
    1.30 +                                omiCopy.UnRead = false;
    1.31 +                                omiCopy.SetPEPProperty(MailItemExtensions.PEPProperty.AutoConsume, "yes");
    1.32                                  copiedFPP.Add(omi.EntryID);
    1.33                                  copiedFPP.Add(omiCopy.EntryID);
    1.34                                  Log.Verbose("DecryptionStack.DecryptionTimer_Tick: Copy OMI: " + omi.EntryID + " to: " + omiCopy.EntryID);
    1.35                              }
    1.36                              catch (Exception ex)
    1.37                              {
    1.38 +                                omiCopy = null;
    1.39                                  Log.Error("DecryptionStack.DecryptionTimer_Tick: Error during copying FPP mailitem: " + ex.ToString());
    1.40                              }
    1.41                          }
    1.42  
    1.43 -                        var fppMessage = new FPPMessage(omiCopy ?? omi);
    1.44 +                        FPPMessage fppMessage = new FPPMessage(omiCopy ?? omi);
    1.45  
    1.46                          try
    1.47                          {
     2.1 --- a/UI/HandshakeDialog.xaml.cs	Tue Apr 17 15:47:29 2018 +0200
     2.2 +++ b/UI/HandshakeDialog.xaml.cs	Thu Apr 19 09:29:31 2018 +0200
     2.3 @@ -726,7 +726,6 @@
     2.4                              {
     2.5                                  item.AreTabControlsVisible = true;
     2.6                                  item.ActiveTab = HandshakeItem.Tabs.Fingerprint;
     2.7 -                                Log.Verbose("Build Handshake Dialog: "+ identity?.Address + " User Id: " + identity?.UserId +" is not a pEp user. Communication Type: " + identity?.CommunicationType.ToString());
     2.8                              }
     2.9  
    2.10                              // Set properties according to color