Merge with default Redesign_Ribbon
authorThomas
Thu, 10 May 2018 11:48:25 +0200
branchRedesign_Ribbon
changeset 2181b68ac248b9d8
parent 2153 01e0b8864644
parent 2180 e43aa424a621
child 2183 74999a6fa16a
Merge with default
CryptableMailItem.cs
DecryptionStack.cs
Extensions/MailItemExtensions.cs
MsgProcessor.cs
PEPMessage.cs
Properties/Resources.Designer.cs
Properties/Resources.resx
pEpForOutlook.csproj
     1.1 --- a/CryptableMailItem.cs	Wed Apr 25 11:48:58 2018 +0200
     1.2 +++ b/CryptableMailItem.cs	Thu May 10 11:48:25 2018 +0200
     1.3 @@ -1180,10 +1180,6 @@
     1.4                  // Reset status
     1.5                  this._LastProcessedStatus = Globals.ReturnStatus.Success;
     1.6  
     1.7 -                // Detect if the mail item is a draft
     1.8 -                isDraft = this.internalMailItem.GetIsDraft();
     1.9 -                isSubmitted = this.internalMailItem.GetIsSubmitted();
    1.10 -
    1.11                  // Make sure this mail item is not already being decrypted
    1.12                  if (string.IsNullOrEmpty(entryId) == false)
    1.13                  {
    1.14 @@ -1234,7 +1230,7 @@
    1.15                  else
    1.16                  {
    1.17                      // Log the issue unless the MailItem is an unsaved draft message
    1.18 -                    if (isDraft == false)
    1.19 +                    if (this.internalMailItem.GetIsDraft() == false)
    1.20                      {
    1.21                          Log.Warning("ProcessAndGetRating: EntryID does not exist, unable to lock during decryption.");
    1.22                      }
    1.23 @@ -1284,6 +1280,10 @@
    1.24                  }
    1.25                  catch { }
    1.26  
    1.27 +                // Detect if the mail item is a draft
    1.28 +                isDraft = this.internalMailItem.GetIsDraft();
    1.29 +                isSubmitted = this.internalMailItem.GetIsSubmitted();
    1.30 +
    1.31                  // Do not processes deleted messages on IMAP
    1.32                  if ((fullCalculation) &&
    1.33                      (this.internalMailItem.GetIsInIMAPStore()) &&
     2.1 --- a/Extensions/MailItemExtensions.cs	Wed Apr 25 11:48:58 2018 +0200
     2.2 +++ b/Extensions/MailItemExtensions.cs	Thu May 10 11:48:25 2018 +0200
     2.3 @@ -630,18 +630,13 @@
     2.4                       */
     2.5  
     2.6                      str = omi.ConversationIndex;
     2.7 -                    if (str != null)
     2.8 +                    bytes = MapiHelper.StringToPtypBinary(str);
     2.9 +                    if (bytes?.Length > 0)
    2.10                      {
    2.11 -                        bytes = new byte[str.Length / 2];
    2.12 -                        for (int i = 0; i < str.Length; i += 2)
    2.13 -                        {
    2.14 -                            bytes[i / 2] = Convert.ToByte(str.Substring(i, 2), 16);
    2.15 -                        }
    2.16 -
    2.17                          MapiHelper.SetProperty(mirror, MapiProperty.PidTagConversationIndex, bytes);
    2.18                      }
    2.19  
    2.20 -                    MapiHelper.SetProperty(mirror, MapiProperty.PidTagConversationIndexTracking, false);
    2.21 +                    MapiHelper.SetProperty(mirror, MapiProperty.PidTagConversationIndexTracking, true);
    2.22                      MapiHelper.SetProperty(mirror, MapiProperty.PidTagConversationTopic, omi.ConversationTopic);
    2.23                  }
    2.24                  catch (Exception ex)
    2.25 @@ -652,7 +647,7 @@
    2.26                  mirror.To = omi.To;
    2.27                  mirror.CC = omi.CC;
    2.28                  mirror.BCC = omi.BCC;
    2.29 -                mirror.Subject = "p≡p";
    2.30 +                mirror.Subject = omi.Subject;
    2.31                  mirror.Body = string.Empty;
    2.32                  mirror.Save();
    2.33  
     3.1 --- a/MsgProcessor.cs	Wed Apr 25 11:48:58 2018 +0200
     3.2 +++ b/MsgProcessor.cs	Thu May 10 11:48:25 2018 +0200
     3.3 @@ -1168,7 +1168,7 @@
     3.4              bool success = false;
     3.5              TextMessage src;
     3.6              TextMessage dst = new TextMessage();
     3.7 -            string[] dstKeyList = new string[0];
     3.8 +            string[] dstKeyList = Globals.ThisAddIn.Settings.ExtraKeys ?? new string[0];
     3.9              pEpRating rating = pEpRating.pEpRatingCannotDecrypt;
    3.10              Globals.ReturnStatus sts;
    3.11              flags = pEpDecryptFlags.pEpDecryptFlagsNone;
    3.12 @@ -1182,7 +1182,7 @@
    3.13                  try
    3.14                  {
    3.15                      src = sourceMessage.ToCOMType();
    3.16 -                    rating = ThisAddIn.PEPEngine.DecryptMessage(src, out dst, out dstKeyList, out flags);
    3.17 +                    rating = ThisAddIn.PEPEngine.DecryptMessage(src, out dst, ref dstKeyList, ref flags);
    3.18                      success = true;
    3.19                  }
    3.20                  catch (COMException ex)
     4.1 --- a/PEPMessage.cs	Wed Apr 25 11:48:58 2018 +0200
     4.2 +++ b/PEPMessage.cs	Thu May 10 11:48:25 2018 +0200
     4.3 @@ -1909,13 +1909,12 @@
     4.4                       * See: https://msdn.microsoft.com/en-us/library/ee204279.aspx
     4.5                       */
     4.6                      bytes = MapiHelper.StringToPtypBinary(this._ConversationIndex);
     4.7 -                    if ((bytes != null) &&
     4.8 -                        (bytes.Length > 0))
     4.9 +                    if (bytes?.Length > 0)
    4.10                      {
    4.11                          MapiHelper.SetProperty(omi, MapiProperty.PidTagConversationIndex, bytes);
    4.12                      }
    4.13  
    4.14 -                    MapiHelper.SetProperty(omi, MapiProperty.PidTagConversationIndexTracking, false);
    4.15 +                    MapiHelper.SetProperty(omi, MapiProperty.PidTagConversationIndexTracking, true);
    4.16  
    4.17                      if (string.IsNullOrEmpty(this._ConversationTopic))
    4.18                      {
     5.1 --- a/Properties/AssemblyInfo.cs	Wed Apr 25 11:48:58 2018 +0200
     5.2 +++ b/Properties/AssemblyInfo.cs	Thu May 10 11:48:25 2018 +0200
     5.3 @@ -43,5 +43,5 @@
     5.4  // You can specify all the values or you can default the Build and Revision Numbers 
     5.5  // by using the '*' as shown below:
     5.6  // [assembly: AssemblyVersion("1.0.*")]
     5.7 -[assembly: AssemblyVersion("1.0.102.0")]
     5.8 -[assembly: AssemblyFileVersion("1.0.102.0")]
     5.9 +[assembly: AssemblyVersion("1.0.103.0")]
    5.10 +[assembly: AssemblyFileVersion("1.0.103.0")]
     6.1 --- a/Properties/Resources.Designer.cs	Wed Apr 25 11:48:58 2018 +0200
     6.2 +++ b/Properties/Resources.Designer.cs	Thu May 10 11:48:25 2018 +0200
     6.3 @@ -1423,6 +1423,15 @@
     6.4          }
     6.5          
     6.6          /// <summary>
     6.7 +        ///   Looks up a localized string similar to Trustwords default language:.
     6.8 +        /// </summary>
     6.9 +        public static string Options_TrustwordsLanguageText {
    6.10 +            get {
    6.11 +                return ResourceManager.GetString("Options_TrustwordsLanguageText", resourceCulture);
    6.12 +            }
    6.13 +        }
    6.14 +        
    6.15 +        /// <summary>
    6.16          ///   Looks up a localized string similar to Cc.
    6.17          /// </summary>
    6.18          public static string PreviewMessage_CcText {
     7.1 --- a/Properties/Resources.de.resx	Wed Apr 25 11:48:58 2018 +0200
     7.2 +++ b/Properties/Resources.de.resx	Thu May 10 11:48:25 2018 +0200
     7.3 @@ -713,4 +713,7 @@
     7.4    <data name="Options_IsPassiveModeEnabledText" xml:space="preserve">
     7.5      <value>Passivmodus aktivieren</value>
     7.6    </data>
     7.7 +  <data name="Options_TrustwordsLanguageText" xml:space="preserve">
     7.8 +    <value>Standardsprache der Trustwords:</value>
     7.9 +  </data>
    7.10  </root>
    7.11 \ No newline at end of file
     8.1 --- a/Properties/Resources.resx	Wed Apr 25 11:48:58 2018 +0200
     8.2 +++ b/Properties/Resources.resx	Thu May 10 11:48:25 2018 +0200
     8.3 @@ -814,4 +814,7 @@
     8.4    <data name="Options_IsPassiveModeEnabledText" xml:space="preserve">
     8.5        <value>Enable Passive Mode</value>
     8.6      </data>
     8.7 +  <data name="Options_TrustwordsLanguageText" xml:space="preserve">
     8.8 +    <value>Trustwords default language:</value>
     8.9 +  </data>
    8.10  </root>
    8.11 \ No newline at end of file
     9.1 --- a/UI/FormControlOptions.xaml	Wed Apr 25 11:48:58 2018 +0200
     9.2 +++ b/UI/FormControlOptions.xaml	Thu May 10 11:48:25 2018 +0200
     9.3 @@ -290,8 +290,8 @@
     9.4                                              </StackPanel.Margin>
     9.5                                              <CheckBox IsThreeState="False"
     9.6                                                        IsChecked="{Binding Path=IsDecryptAlwaysEnabled, Mode=TwoWay}"
     9.7 -                                                      IsEnabled="True" 
     9.8 -                                                      Margin="20,0,0,0"/>
     9.9 +                                                      IsEnabled="True"
    9.10 +                                                      Margin="20,0,0,0" />
    9.11                                              <TextBlock Text="{x:Static p:Resources.Options_IsDecryptAlwaysEnabledText}"
    9.12                                                         Margin="3,2,0,0" />
    9.13                                          </StackPanel>
    9.14 @@ -397,19 +397,21 @@
    9.15                                         TextWrapping="Wrap"
    9.16                                         Margin="{StaticResource CheckBoxContentMarginWhenTop}" />
    9.17                          </CheckBox>
    9.18 -                        <ComboBox Grid.Row="4"
    9.19 -                                  ItemsSource="{Binding Path=TrustwordsCultureList}"
    9.20 -                                  DisplayMemberPath="Value"
    9.21 -                                  SelectedValuePath="Key"
    9.22 -                                  SelectedValue="{Binding Path=TrustwordsCulture, Mode=TwoWay}"
    9.23 -                                  Visibility="{Binding ElementName=CheckBoxIsAdvancedEnabled, Path=IsChecked, Mode=OneWay, Converter={StaticResource BoolToVisibility}}">
    9.24 -                            <ComboBox.Margin>
    9.25 -                                <Thickness Bottom="0"
    9.26 -                                           Left="0"
    9.27 -                                           Right="0"
    9.28 -                                           Top="{StaticResource PageSubSectionSpacing}" />
    9.29 -                            </ComboBox.Margin>
    9.30 -                        </ComboBox>
    9.31 +                        <StackPanel Grid.Row="4"
    9.32 +                                    Orientation="Horizontal"
    9.33 +                                    VerticalAlignment="Center"
    9.34 +                                    HorizontalAlignment="Left"
    9.35 +                                    Visibility="{Binding ElementName=CheckBoxIsAdvancedEnabled, Path=IsChecked, Mode=OneWay, Converter={StaticResource BoolToVisibility}}">
    9.36 +                            <Label Content="{x:Static p:Resources.Options_TrustwordsLanguageText}"
    9.37 +                                   VerticalAlignment="Center"
    9.38 +                                   Margin="0,2" />
    9.39 +                            <ComboBox ItemsSource="{Binding Path=TrustwordsCultureList}"
    9.40 +                                      DisplayMemberPath="Value"
    9.41 +                                      SelectedValuePath="Key"
    9.42 +                                      SelectedValue="{Binding Path=TrustwordsCulture, Mode=TwoWay}"
    9.43 +                                      Margin="5">
    9.44 +                            </ComboBox>
    9.45 +                        </StackPanel>
    9.46                      </Grid>
    9.47  
    9.48                  </Grid>
    10.1 --- a/UI/FormControlOptions.xaml.cs	Wed Apr 25 11:48:58 2018 +0200
    10.2 +++ b/UI/FormControlOptions.xaml.cs	Thu May 10 11:48:25 2018 +0200
    10.3 @@ -699,8 +699,8 @@
    10.4                  set
    10.5                  {
    10.6                      this._IsPassiveModeEnabled = value;
    10.7 -                    this.RaisePropertyChangedEvent(nameof(this.IsPassiveModeEnabled)); 
    10.8 -                                       
    10.9 +                    this.RaisePropertyChangedEvent(nameof(this.IsPassiveModeEnabled));
   10.10 +
   10.11                      this.CalcDependentProperties();
   10.12                  }
   10.13              }
   10.14 @@ -1499,231 +1499,239 @@
   10.15                  {
   10.16                      calcDepPropIsEnabled = false;
   10.17  
   10.18 -                    // AccountSettingsList
   10.19 -                    foreach (AccountState entry in this._AccountSettingsList)
   10.20 +                    try
   10.21                      {
   10.22 -                        // IsPEPEnabled
   10.23 -                        if (this._IsAdvancedEnabled == false)
   10.24 +                        // AccountSettingsList
   10.25 +                        foreach (AccountState entry in this._AccountSettingsList)
   10.26                          {
   10.27 -                            // Do not modify the stored real value for IsPEPEnabled
   10.28 -                            entry.IsPEPEnabledOptionChecked = entry.IsPEPEnabled;
   10.29 -                            entry.IsPEPEnabledOptionEnabled = false;
   10.30 -                            entry.IsPEPEnabledOptionVisible = false;
   10.31 -                            entry.IsPEPEnabledOverridden = true;
   10.32 +                            // IsPEPEnabled
   10.33 +                            if (this._IsAdvancedEnabled == false)
   10.34 +                            {
   10.35 +                                // Do not modify the stored real value for IsPEPEnabled
   10.36 +                                entry.IsPEPEnabledOptionChecked = entry.IsPEPEnabled;
   10.37 +                                entry.IsPEPEnabledOptionEnabled = false;
   10.38 +                                entry.IsPEPEnabledOptionVisible = false;
   10.39 +                                entry.IsPEPEnabledOverridden = true;
   10.40 +                            }
   10.41 +                            else
   10.42 +                            {
   10.43 +                                // Check if the value was previously overridden
   10.44 +                                if (entry.IsPEPEnabledOverridden)
   10.45 +                                {
   10.46 +                                    entry.IsPEPEnabledOptionChecked = entry.IsPEPEnabled;
   10.47 +                                }
   10.48 +                                else
   10.49 +                                {
   10.50 +                                    entry.IsPEPEnabled = entry.IsPEPEnabledOptionChecked;
   10.51 +                                }
   10.52 +
   10.53 +                                // Show/enable all
   10.54 +                                entry.IsPEPEnabledOptionEnabled = true;
   10.55 +                                entry.IsPEPEnabledOptionVisible = true;
   10.56 +                                entry.IsPEPEnabledOverridden = false;
   10.57 +                            }
   10.58 +
   10.59 +                            // IsDecryptAlwaysEnabledOptionVisible
   10.60 +                            entry.IsDecryptAlwaysEnabledOptionVisible = ((entry.IsPEPEnabled == false) && entry.IsPEPEnabledOptionVisible);
   10.61 +
   10.62 +                            // IsSecureStorageEnabled
   10.63 +                            if (entry.Type.Contains("Eas"))
   10.64 +                            {
   10.65 +                                /* ActiveSync accounts never update the server with client body data.
   10.66 +                                 * If you decrypt locally it will never be decrypted on the server.
   10.67 +                                 * For this reason, setting account trust must be disabled.
   10.68 +                                 * However, to the user it will appear as if the server is 'untrusted'.
   10.69 +                                 * 
   10.70 +                                 * Do not modify the stored real value for IsSecureStorageEnabled
   10.71 +                                 */
   10.72 +                                entry.IsSecureStorageEnabledOptionChecked = true;
   10.73 +                                entry.IsSecureStorageEnabledOptionEnabled = false;
   10.74 +                                entry.IsSecureStorageEnabledOptionVisible = true;
   10.75 +                                entry.IsSecureStorageEnabledOverridden = true;
   10.76 +                            }
   10.77 +                            else if (this._IsEncryptAllAccountsEnabled)
   10.78 +                            {
   10.79 +                                /* If 'Store messages securely for all accounts' is enabled then show each account
   10.80 +                                 * as secure. This will still preserve whatever the past user setting was for the account.
   10.81 +                                 * This can be done because processing will use the 'IsEncryptAllAccountsEnabled' as an override.
   10.82 +                                 * 
   10.83 +                                 * Do not modify the stored real value for IsSecureStorageEnabled
   10.84 +                                 */
   10.85 +                                entry.IsSecureStorageEnabledOptionChecked = true;
   10.86 +                                entry.IsSecureStorageEnabledOptionEnabled = false;
   10.87 +                                entry.IsSecureStorageEnabledOptionVisible = true;
   10.88 +                                entry.IsSecureStorageEnabledOverridden = true;
   10.89 +                            }
   10.90 +                            else
   10.91 +                            {
   10.92 +                                // Check if the value was previously overridden
   10.93 +                                if (entry.IsSecureStorageEnabledOverridden)
   10.94 +                                {
   10.95 +                                    entry.IsSecureStorageEnabledOptionChecked = entry.IsSecureStorageEnabled;
   10.96 +                                }
   10.97 +                                else
   10.98 +                                {
   10.99 +                                    entry.IsSecureStorageEnabled = entry.IsSecureStorageEnabledOptionChecked;
  10.100 +                                }
  10.101 +
  10.102 +                                // Show/enable all
  10.103 +                                entry.IsSecureStorageEnabledOptionEnabled = true;
  10.104 +                                entry.IsSecureStorageEnabledOptionVisible = true;
  10.105 +                                entry.IsSecureStorageEnabledOverridden = false;
  10.106 +                            }
  10.107 +
  10.108 +                            // IsSyncEnabled
  10.109 +                            if (this._IsAdvancedEnabled == false)
  10.110 +                            {
  10.111 +                                // Do not modify the stored real value for IsPEPEnabled
  10.112 +                                entry.IsSyncEnabledOptionChecked = entry.IsSyncEnabled;
  10.113 +                                entry.IsSyncEnabledOptionEnabled = false;
  10.114 +                                entry.IsSyncEnabledOptionVisible = false;
  10.115 +                                entry.IsSyncEnabledOverridden = false;
  10.116 +                            }
  10.117 +                            else if (entry.IsPEPEnabled == false)
  10.118 +                            {
  10.119 +                                // Do not modify the stored real value for IsSyncEnabled
  10.120 +                                entry.IsSyncEnabledOptionChecked = false;
  10.121 +                                entry.IsSyncEnabledOptionEnabled = false;
  10.122 +                                entry.IsSyncEnabledOptionVisible = true;
  10.123 +                                entry.IsSyncEnabledOverridden = true;
  10.124 +                            }
  10.125 +                            else if (entry.Type.Contains("Imap"))
  10.126 +                            {
  10.127 +                                entry.IsSyncEnabledOptionEnabled = false;
  10.128 +                                entry.IsSyncEnabledOptionChecked = false;
  10.129 +                                entry.IsSyncEnabledOptionVisible = true;
  10.130 +                                entry.IsSyncEnabledOverridden = true;
  10.131 +                            }
  10.132 +                            else if (this._IsSyncEnabledForAllAccounts)
  10.133 +                            {
  10.134 +                                /* If 'Disable pEp sync for all accounts' is checked, show sync disabled for each account. 
  10.135 +                                 * This will still preserve whatever the past user setting was for the account.
  10.136 +                                 * This can be done because processing will use the 'IsSyncDisabledForAllAccounts' as an override.
  10.137 +                                 * 
  10.138 +                                 * Do not modify the stored real value for IsSyncEnabled
  10.139 +                                 */
  10.140 +                                entry.IsSyncEnabledOptionChecked = false;
  10.141 +                                entry.IsSyncEnabledOptionEnabled = false;
  10.142 +                                entry.IsSyncEnabledOptionVisible = true;
  10.143 +                                entry.IsSyncEnabledOverridden = true;
  10.144 +                            }
  10.145 +                            else
  10.146 +                            {
  10.147 +                                // Check if the value was previously overridden
  10.148 +                                if (entry.IsSyncEnabledOverridden)
  10.149 +                                {
  10.150 +                                    entry.IsSyncEnabledOptionChecked = entry.IsSyncEnabled;
  10.151 +                                }
  10.152 +                                else
  10.153 +                                {
  10.154 +                                    entry.IsSyncEnabled = entry.IsSyncEnabledOptionChecked;
  10.155 +                                }
  10.156 +
  10.157 +                                // Show/enable all
  10.158 +                                entry.IsSyncEnabledOptionEnabled = true;
  10.159 +                                entry.IsSyncEnabledOptionVisible = true;
  10.160 +                                entry.IsSyncEnabledOverridden = false;
  10.161 +                            }
  10.162 +                        }
  10.163 +
  10.164 +                        /* Warning:
  10.165 +                         * The BlacklistDisplayed property is bound to the UI listbox along with selected value (BlacklistSelectedIndex).
  10.166 +                         * This means whenever the BlacklistDisplayed is modified, the UI updates the selected value automatically (which calls CalcDependentProperties).
  10.167 +                         * Finally, this results in CalcDependentProperties triggering a call to CalcDependentProperties within itself.
  10.168 +                         * To avoid an overflow in this sitaution, the calcDepPropIsEnabled is used which disabled the code from running a second
  10.169 +                         * time before the first time is finished.
  10.170 +                         */
  10.171 +
  10.172 +                        // Save the selection as it is usually cleared due to list changes and binding
  10.173 +                        if ((this._BlacklistSelectedIndex >= 0) &&
  10.174 +                            (this._BlacklistSelectedIndex < this._BlacklistDisplayed.Count))
  10.175 +                        {
  10.176 +                            selectedItem = this._BlacklistDisplayed[this._BlacklistSelectedIndex];
  10.177 +                        }
  10.178 +
  10.179 +                        // BlacklistDisplayed
  10.180 +                        if (string.IsNullOrWhiteSpace(this._BlacklistEnteredFingerprint) == false)
  10.181 +                        {
  10.182 +                            fpr1 = Globals.ThisAddIn.RemoveFprFormatting(this._BlacklistEnteredFingerprint);
  10.183 +                            criteria = this._BlacklistEnteredFingerprint.Trim().ToUpperInvariant();
  10.184 +                            this._BlacklistDisplayed.Clear();
  10.185 +
  10.186 +                            // Fill only matches
  10.187 +                            foreach (KVPair<PEPIdentity, bool> entry in this._Blacklist)
  10.188 +                            {
  10.189 +                                fpr2 = Globals.ThisAddIn.RemoveFprFormatting(entry.Key.Fingerprint);
  10.190 +
  10.191 +                                // Match by user name, address or fingerprint. All case-insensitive
  10.192 +                                if (((string.IsNullOrEmpty(entry.Key.Address) == false) &&
  10.193 +                                     (entry.Key.Address.ToUpperInvariant().Contains(criteria))) ||
  10.194 +                                    ((string.IsNullOrEmpty(entry.Key.UserName) == false) &&
  10.195 +                                     (entry.Key.UserName.ToUpperInvariant().Contains(criteria))) ||
  10.196 +                                    ((string.IsNullOrEmpty(fpr2) == false) &&
  10.197 +                                     ((fpr2.StartsWith(fpr1)) ||
  10.198 +                                      ((fpr2.Length == 40) &&
  10.199 +                                       (fpr2.Substring(32, 8).StartsWith(fpr1))))))
  10.200 +                                {
  10.201 +                                    this._BlacklistDisplayed.Add(entry); // Must add by reference
  10.202 +                                }
  10.203 +                            }
  10.204                          }
  10.205                          else
  10.206                          {
  10.207 -                            // Check if the value was previously overridden
  10.208 -                            if (entry.IsPEPEnabledOverridden)
  10.209 -                            {
  10.210 -                                entry.IsPEPEnabledOptionChecked = entry.IsPEPEnabled;
  10.211 -                            }
  10.212 -                            else
  10.213 -                            {
  10.214 -                                entry.IsPEPEnabled = entry.IsPEPEnabledOptionChecked;
  10.215 -                            }
  10.216 +                            this._BlacklistDisplayed.Clear();
  10.217  
  10.218 -                            // Show/enable all
  10.219 -                            entry.IsPEPEnabledOptionEnabled = true;
  10.220 -                            entry.IsPEPEnabledOptionVisible = true;
  10.221 -                            entry.IsPEPEnabledOverridden = false;
  10.222 -                        }
  10.223 -
  10.224 -                        // IsDecryptAlwaysEnabledOptionVisible
  10.225 -                        entry.IsDecryptAlwaysEnabledOptionVisible = ((entry.IsPEPEnabled == false) && entry.IsPEPEnabledOptionVisible);
  10.226 -
  10.227 -                        // IsSecureStorageEnabled
  10.228 -                        if (entry.Type.Contains("Eas"))
  10.229 -                        {
  10.230 -                            /* ActiveSync accounts never update the server with client body data.
  10.231 -                             * If you decrypt locally it will never be decrypted on the server.
  10.232 -                             * For this reason, setting account trust must be disabled.
  10.233 -                             * However, to the user it will appear as if the server is 'untrusted'.
  10.234 -                             * 
  10.235 -                             * Do not modify the stored real value for IsSecureStorageEnabled
  10.236 -                             */
  10.237 -                            entry.IsSecureStorageEnabledOptionChecked = true;
  10.238 -                            entry.IsSecureStorageEnabledOptionEnabled = false;
  10.239 -                            entry.IsSecureStorageEnabledOptionVisible = true;
  10.240 -                            entry.IsSecureStorageEnabledOverridden = true;
  10.241 -                        }
  10.242 -                        else if (this._IsEncryptAllAccountsEnabled)
  10.243 -                        {
  10.244 -                            /* If 'Store messages securely for all accounts' is enabled then show each account
  10.245 -                             * as secure. This will still preserve whatever the past user setting was for the account.
  10.246 -                             * This can be done because processing will use the 'IsEncryptAllAccountsEnabled' as an override.
  10.247 -                             * 
  10.248 -                             * Do not modify the stored real value for IsSecureStorageEnabled
  10.249 -                             */
  10.250 -                            entry.IsSecureStorageEnabledOptionChecked = true;
  10.251 -                            entry.IsSecureStorageEnabledOptionEnabled = false;
  10.252 -                            entry.IsSecureStorageEnabledOptionVisible = true;
  10.253 -                            entry.IsSecureStorageEnabledOverridden = true;
  10.254 -                        }
  10.255 -                        else
  10.256 -                        {
  10.257 -                            // Check if the value was previously overridden
  10.258 -                            if (entry.IsSecureStorageEnabledOverridden)
  10.259 -                            {
  10.260 -                                entry.IsSecureStorageEnabledOptionChecked = entry.IsSecureStorageEnabled;
  10.261 -                            }
  10.262 -                            else
  10.263 -                            {
  10.264 -                                entry.IsSecureStorageEnabled = entry.IsSecureStorageEnabledOptionChecked;
  10.265 -                            }
  10.266 -
  10.267 -                            // Show/enable all
  10.268 -                            entry.IsSecureStorageEnabledOptionEnabled = true;
  10.269 -                            entry.IsSecureStorageEnabledOptionVisible = true;
  10.270 -                            entry.IsSecureStorageEnabledOverridden = false;
  10.271 -                        }
  10.272 -
  10.273 -                        // IsSyncEnabled
  10.274 -                        if (this._IsAdvancedEnabled == false)
  10.275 -                        {
  10.276 -                            // Do not modify the stored real value for IsPEPEnabled
  10.277 -                            entry.IsSyncEnabledOptionChecked = entry.IsSyncEnabled;
  10.278 -                            entry.IsSyncEnabledOptionEnabled = false;
  10.279 -                            entry.IsSyncEnabledOptionVisible = false;
  10.280 -                            entry.IsSyncEnabledOverridden = false;
  10.281 -                        }
  10.282 -                        else if (entry.IsPEPEnabled == false)
  10.283 -                        {
  10.284 -                            // Do not modify the stored real value for IsSyncEnabled
  10.285 -                            entry.IsSyncEnabledOptionChecked = false;
  10.286 -                            entry.IsSyncEnabledOptionEnabled = false;
  10.287 -                            entry.IsSyncEnabledOptionVisible = true;
  10.288 -                            entry.IsSyncEnabledOverridden = true;
  10.289 -                        }
  10.290 -                        else if (entry.Type.Contains("Imap"))
  10.291 -                        {
  10.292 -                            entry.IsSyncEnabledOptionEnabled = false;
  10.293 -                            entry.IsSyncEnabledOptionChecked = false;
  10.294 -                            entry.IsSyncEnabledOptionVisible = true;
  10.295 -                            entry.IsSyncEnabledOverridden = true;
  10.296 -                        }
  10.297 -                        else if (this._IsSyncEnabledForAllAccounts)
  10.298 -                        {
  10.299 -                            /* If 'Disable pEp sync for all accounts' is checked, show sync disabled for each account. 
  10.300 -                             * This will still preserve whatever the past user setting was for the account.
  10.301 -                             * This can be done because processing will use the 'IsSyncDisabledForAllAccounts' as an override.
  10.302 -                             * 
  10.303 -                             * Do not modify the stored real value for IsSyncEnabled
  10.304 -                             */
  10.305 -                            entry.IsSyncEnabledOptionChecked = false;
  10.306 -                            entry.IsSyncEnabledOptionEnabled = false;
  10.307 -                            entry.IsSyncEnabledOptionVisible = true;
  10.308 -                            entry.IsSyncEnabledOverridden = true;
  10.309 -                        }
  10.310 -                        else
  10.311 -                        {
  10.312 -                            // Check if the value was previously overridden
  10.313 -                            if (entry.IsSyncEnabledOverridden)
  10.314 -                            {
  10.315 -                                entry.IsSyncEnabledOptionChecked = entry.IsSyncEnabled;
  10.316 -                            }
  10.317 -                            else
  10.318 -                            {
  10.319 -                                entry.IsSyncEnabled = entry.IsSyncEnabledOptionChecked;
  10.320 -                            }
  10.321 -
  10.322 -                            // Show/enable all
  10.323 -                            entry.IsSyncEnabledOptionEnabled = true;
  10.324 -                            entry.IsSyncEnabledOptionVisible = true;
  10.325 -                            entry.IsSyncEnabledOverridden = false;
  10.326 -                        }
  10.327 -                    }
  10.328 -
  10.329 -                    /* Warning:
  10.330 -                     * The BlacklistDisplayed property is bound to the UI listbox along with selected value (BlacklistSelectedIndex).
  10.331 -                     * This means whenever the BlacklistDisplayed is modified, the UI updates the selected value automatically (which calls CalcDependentProperties).
  10.332 -                     * Finally, this results in CalcDependentProperties triggering a call to CalcDependentProperties within itself.
  10.333 -                     * To avoid an overflow in this sitaution, the calcDepPropIsEnabled is used which disabled the code from running a second
  10.334 -                     * time before the first time is finished.
  10.335 -                     */
  10.336 -
  10.337 -                    // Save the selection as it is usually cleared due to list changes and binding
  10.338 -                    if ((this._BlacklistSelectedIndex >= 0) &&
  10.339 -                        (this._BlacklistSelectedIndex < this._BlacklistDisplayed.Count))
  10.340 -                    {
  10.341 -                        selectedItem = this._BlacklistDisplayed[this._BlacklistSelectedIndex];
  10.342 -                    }
  10.343 -
  10.344 -                    // BlacklistDisplayed
  10.345 -                    if (string.IsNullOrWhiteSpace(this._BlacklistEnteredFingerprint) == false)
  10.346 -                    {
  10.347 -                        fpr1 = Globals.ThisAddIn.RemoveFprFormatting(this._BlacklistEnteredFingerprint);
  10.348 -                        criteria = this._BlacklistEnteredFingerprint.Trim().ToUpperInvariant();
  10.349 -                        this._BlacklistDisplayed.Clear();
  10.350 -
  10.351 -                        // Fill only matches
  10.352 -                        foreach (KVPair<PEPIdentity, bool> entry in this._Blacklist)
  10.353 -                        {
  10.354 -                            fpr2 = Globals.ThisAddIn.RemoveFprFormatting(entry.Key.Fingerprint);
  10.355 -
  10.356 -                            // Match by user name, address or fingerprint. All case-insensitive
  10.357 -                            if (((string.IsNullOrEmpty(entry.Key.Address) == false) &&
  10.358 -                                 (entry.Key.Address.ToUpperInvariant().Contains(criteria))) ||
  10.359 -                                ((string.IsNullOrEmpty(entry.Key.UserName) == false) &&
  10.360 -                                 (entry.Key.UserName.ToUpperInvariant().Contains(criteria))) ||
  10.361 -                                ((string.IsNullOrEmpty(fpr2) == false) &&
  10.362 -                                 ((fpr2.StartsWith(fpr1)) ||
  10.363 -                                  ((fpr2.Length == 40) &&
  10.364 -                                   (fpr2.Substring(32, 8).StartsWith(fpr1))))))
  10.365 +                            // Fill all
  10.366 +                            foreach (KVPair<PEPIdentity, bool> entry in this._Blacklist)
  10.367                              {
  10.368                                  this._BlacklistDisplayed.Add(entry); // Must add by reference
  10.369                              }
  10.370                          }
  10.371 -                    }
  10.372 -                    else
  10.373 -                    {
  10.374 -                        this._BlacklistDisplayed.Clear();
  10.375 +                        // Note: BlacklistDisplayed is observable so no need for raising event
  10.376  
  10.377 -                        // Fill all
  10.378 -                        foreach (KVPair<PEPIdentity, bool> entry in this._Blacklist)
  10.379 +                        // BlacklistSelectedIndex (needed to restore after modifying the list)
  10.380 +                        if (selectedItem != null)
  10.381                          {
  10.382 -                            this._BlacklistDisplayed.Add(entry); // Must add by reference
  10.383 -                        }
  10.384 -                    }
  10.385 -                    // Note: BlacklistDisplayed is observable so no need for raising event
  10.386 +                            exists = false;
  10.387  
  10.388 -                    // BlacklistSelectedIndex (needed to restore after modifying the list)
  10.389 -                    if (selectedItem != null)
  10.390 -                    {
  10.391 -                        exists = false;
  10.392 +                            for (int i = 0; i < this._BlacklistDisplayed.Count; i++)
  10.393 +                            {
  10.394 +                                if (object.ReferenceEquals(selectedItem, this._BlacklistDisplayed[i]))
  10.395 +                                {
  10.396 +                                    this._BlacklistSelectedIndex = i;
  10.397 +                                    exists = true;
  10.398 +                                    break;
  10.399 +                                }
  10.400 +                            }
  10.401  
  10.402 -                        for (int i = 0; i < this._BlacklistDisplayed.Count; i++)
  10.403 -                        {
  10.404 -                            if (object.ReferenceEquals(selectedItem, this._BlacklistDisplayed[i]))
  10.405 +                            if (exists == false)
  10.406                              {
  10.407 -                                this._BlacklistSelectedIndex = i;
  10.408 -                                exists = true;
  10.409 -                                break;
  10.410 +                                this._BlacklistSelectedIndex = -1;
  10.411                              }
  10.412 +
  10.413 +                            this.RaisePropertyChangedEvent(nameof(this.BlacklistSelectedIndex));
  10.414                          }
  10.415  
  10.416 -                        if (exists == false)
  10.417 +                        // IsBlacklistAddEnabled
  10.418 +                        fpr1 = Globals.ThisAddIn.RemoveFprFormatting(this._BlacklistEnteredFingerprint);
  10.419 +                        if ((string.IsNullOrEmpty(fpr1) == false) &&
  10.420 +                            (fpr1.Length == 40) &&
  10.421 +                            (this._BlacklistDisplayed.Count == 0) &&
  10.422 +                            (IsHex(fpr1)))
  10.423                          {
  10.424 -                            this._BlacklistSelectedIndex = -1;
  10.425 +                            this._IsBlacklistAddEnabled = true;
  10.426 +                        }
  10.427 +                        else
  10.428 +                        {
  10.429 +                            this._IsBlacklistAddEnabled = false;
  10.430                          }
  10.431  
  10.432 -                        this.RaisePropertyChangedEvent(nameof(this.BlacklistSelectedIndex));
  10.433 +                        this.RaisePropertyChangedEvent(nameof(this.IsBlacklistAddEnabled));
  10.434                      }
  10.435 -
  10.436 -                    // IsBlacklistAddEnabled
  10.437 -                    fpr1 = Globals.ThisAddIn.RemoveFprFormatting(this._BlacklistEnteredFingerprint);
  10.438 -                    if ((string.IsNullOrEmpty(fpr1) == false) &&
  10.439 -                        (fpr1.Length == 40) &&
  10.440 -                        (this._BlacklistDisplayed.Count == 0) &&
  10.441 -                        (IsHex(fpr1)))
  10.442 +                    catch (Exception ex)
  10.443                      {
  10.444 -                        this._IsBlacklistAddEnabled = true;
  10.445 +                        Log.Error("CalcDependentProperties: Error occured. " + ex.ToString());
  10.446                      }
  10.447 -                    else
  10.448 -                    {
  10.449 -                        this._IsBlacklistAddEnabled = false;
  10.450 -                    }
  10.451 -                    this.RaisePropertyChangedEvent(nameof(this.IsBlacklistAddEnabled));
  10.452  
  10.453                      calcDepPropIsEnabled = true;
  10.454                  }
  10.455 @@ -2073,6 +2081,7 @@
  10.456              {
  10.457                  base.Reset();
  10.458  
  10.459 +                this._IsDecryptAlwaysEnabledOptionVisible = false;
  10.460                  this._IsPEPEnabledOptionChecked = base._IsPEPEnabled;
  10.461                  this._IsPEPEnabledOptionEnabled = true;
  10.462                  this._IsPEPEnabledOptionVisible = true;
  10.463 @@ -2119,6 +2128,7 @@
  10.464                  copy.SmtpAddress = base._SmtpAddress;
  10.465                  copy.Type = base._Type;
  10.466  
  10.467 +                copy.IsDecryptAlwaysEnabledOptionVisible = this._IsDecryptAlwaysEnabledOptionVisible;
  10.468                  copy.IsPEPEnabledOptionChecked = this._IsPEPEnabledOptionChecked;
  10.469                  copy.IsPEPEnabledOptionEnabled = this._IsPEPEnabledOptionEnabled;
  10.470                  copy.IsPEPEnabledOptionVisible = this._IsPEPEnabledOptionVisible;
    11.1 --- a/UI/FormControlPreviewMessage.xaml	Wed Apr 25 11:48:58 2018 +0200
    11.2 +++ b/UI/FormControlPreviewMessage.xaml	Thu May 10 11:48:25 2018 +0200
    11.3 @@ -93,7 +93,7 @@
    11.4                      <TextBlock VerticalAlignment="Center"
    11.5                                 FontFamily="Segoe UI"
    11.6                                 FontSize="12"
    11.7 -                               Text="{Binding Path='ReplyAllText', Mode=OneWay, FallbackValue='Reply All'}" />
    11.8 +                               Text="{x:Static p:Resources.PreviewMessage_ReplyAllText}" />
    11.9                  </StackPanel>
   11.10              </Button>
   11.11              <Button Name="ButtonForward"
    12.1 --- a/pEpForOutlook.csproj	Wed Apr 25 11:48:58 2018 +0200
    12.2 +++ b/pEpForOutlook.csproj	Thu May 10 11:48:25 2018 +0200
    12.3 @@ -43,7 +43,7 @@
    12.4      <PublishUrl>publish\</PublishUrl>
    12.5      <InstallUrl>https://pep-project.org/</InstallUrl>
    12.6      <TargetCulture>en</TargetCulture>
    12.7 -    <ApplicationVersion>1.0.102.0</ApplicationVersion>
    12.8 +    <ApplicationVersion>1.0.103.0</ApplicationVersion>
    12.9      <AutoIncrementApplicationRevision>true</AutoIncrementApplicationRevision>
   12.10      <UpdateEnabled>true</UpdateEnabled>
   12.11      <UpdateInterval>0</UpdateInterval>