Merge with default OUT-497
authorThomas
Mon, 08 Oct 2018 13:38:44 +0200
branchOUT-497
changeset 23969c9dcc84267b
parent 2391 9d346685cd5d
parent 2395 92cd60e3aa02
child 2397 6c3c90d4275e
child 2419 9a5c397ad588
Merge with default
ThisAddIn.cs
pEpForOutlook.csproj
     1.1 --- a/Extensions/AccountExtensions.cs	Fri Oct 05 14:27:03 2018 +0200
     1.2 +++ b/Extensions/AccountExtensions.cs	Mon Oct 08 13:38:44 2018 +0200
     1.3 @@ -26,8 +26,11 @@
     1.4                  acctSettings.Type = account.AccountType.ToString();
     1.5                  acctSettings.UserName = account.UserName;
     1.6  
     1.7 -                // Qualify server trust if not ActiveSync (always trusted as mails don't get synced back to server)
     1.8 -                if (account.AccountType == Outlook.OlAccountType.olEas)
     1.9 +                /* Qualify server trust if not Enterprise Edition (always trusted) or 
    1.10 +                 * ActiveSync (always trusted as mails don't get synced back to server)
    1.11 +                 */
    1.12 +                if ((Globals.RELEASE_MODE == Globals.ReleaseMode.Enterprise) ||
    1.13 +                    (account.AccountType == Outlook.OlAccountType.olEas))
    1.14                  {
    1.15                      acctSettings.IsSecureStorageEnabled = false;
    1.16                  }
     2.1 --- a/Globals.cs	Fri Oct 05 14:27:03 2018 +0200
     2.2 +++ b/Globals.cs	Mon Oct 08 13:38:44 2018 +0200
     2.3 @@ -38,6 +38,8 @@
     2.4  
     2.5  #if READER_RELEASE_MODE
     2.6          public const ReleaseMode RELEASE_MODE = ReleaseMode.Reader;
     2.7 +#elif ENTERPRISE
     2.8 +        public const ReleaseMode RELEASE_MODE = ReleaseMode.Enterprise;
     2.9  #else
    2.10          public const ReleaseMode RELEASE_MODE = ReleaseMode.Standard;
    2.11  #endif
    2.12 @@ -54,7 +56,8 @@
    2.13          public enum ReleaseMode
    2.14          {
    2.15              Standard,
    2.16 -            Reader
    2.17 +            Reader,
    2.18 +            Enterprise
    2.19          }
    2.20  
    2.21          /// <summary>
     3.1 --- a/PEPIdentity.cs	Fri Oct 05 14:27:03 2018 +0200
     3.2 +++ b/PEPIdentity.cs	Mon Oct 08 13:38:44 2018 +0200
     3.3 @@ -871,7 +871,7 @@
     3.4                                                            out PEPIdentity ownIdentity,
     3.5                                                            bool updateOwnIdentity)
     3.6          {
     3.7 -            PEPIdentity ident = null;
     3.8 +            PEPIdentity identity = null;
     3.9              Globals.ReturnStatus status = Globals.ReturnStatus.Failure;
    3.10  
    3.11              if (settings != null)
    3.12 @@ -879,7 +879,7 @@
    3.13                  try
    3.14                  {
    3.15                      // Create base identity from settings
    3.16 -                    ident = new PEPIdentity
    3.17 +                    identity = new PEPIdentity
    3.18                      {
    3.19                          Address = settings.SmtpAddress,
    3.20                          UserName = settings.UserName,
    3.21 @@ -889,7 +889,8 @@
    3.22                      if (updateOwnIdentity)
    3.23                      {
    3.24                          // Update identity and get fingerprint
    3.25 -                        ident = new PEPIdentity(ThisAddIn.PEPEngine.Myself(ident.ToCOMType()));
    3.26 +                        pEpIdentity _identity = identity.ToCOMType();
    3.27 +                        identity = new PEPIdentity(ThisAddIn.PEPEngine.Myself(_identity));
    3.28                      }
    3.29  
    3.30                      // If successful, set status
    3.31 @@ -897,7 +898,7 @@
    3.32                  }
    3.33                  catch (Exception ex)
    3.34                  {
    3.35 -                    ident = null;
    3.36 +                    identity = null;
    3.37                      Log.Error("GetOwnIdentity: Error determining getting own identity. " + ex.ToString());
    3.38                  }
    3.39              }
    3.40 @@ -906,7 +907,7 @@
    3.41                  Log.Error("GetOwnIdentity: pEp settings are null");
    3.42              }
    3.43  
    3.44 -            ownIdentity = ident;
    3.45 +            ownIdentity = identity;
    3.46              return status;
    3.47          }
    3.48  
    3.49 @@ -917,6 +918,7 @@
    3.50          /// </summary>
    3.51          /// <param name="address">The email address to get the own identity from.</param>
    3.52          /// <param name="ownIdentity">The output own identity (may be null).</param>
    3.53 +        /// <param name="updateOwnIdentity">Whether or not to call Myself to get the fingerprint.</param>
    3.54          /// <returns>The own identity or null.</returns>
    3.55          public static Globals.ReturnStatus GetOwnIdentity(string address,
    3.56                                                            out PEPIdentity ownIdentity,
    3.57 @@ -957,9 +959,11 @@
    3.58          /// </summary>
    3.59          /// <param name="omi">The mail item to get the personal identity from.</param>
    3.60          /// <param name="ownIdentity">The output own identity (may be null).</param>
    3.61 +        /// <param name="updateOwnIdentity">Whether or not to call Myself to get the fingerprint.</param>
    3.62          /// <returns>The status of the method.</returns>
    3.63          public static Globals.ReturnStatus GetOwnIdentity(Outlook.MailItem omi,
    3.64 -                                                          out PEPIdentity ownIdentity)
    3.65 +                                                          out PEPIdentity ownIdentity,
    3.66 +                                                          bool updateOwnIdentity = false)
    3.67          {
    3.68              string entryID;
    3.69              string address = null;
    3.70 @@ -1049,7 +1053,7 @@
    3.71                          address = accounts[1].SmtpAddress;
    3.72                      }
    3.73  
    3.74 -                    sts = PEPIdentity.GetOwnIdentity(address, out own);
    3.75 +                    sts = PEPIdentity.GetOwnIdentity(address, out own, updateOwnIdentity);
    3.76                      status = sts; // Can return the just calculated value, therefore set status
    3.77  
    3.78                      /* Try using the mail item received-by user property information directly.
    3.79 @@ -1101,7 +1105,7 @@
    3.80                          /* Note: while From could be used directly, call GetMyIdentity on the address to ensure
    3.81                           * it is an active account in Outlook or registered if new.
    3.82                           */
    3.83 -                        status = PEPIdentity.GetOwnIdentity(from.Address, out own);
    3.84 +                        status = PEPIdentity.GetOwnIdentity(from.Address, out own, updateOwnIdentity);
    3.85                      }
    3.86                      else
    3.87                      {
    3.88 @@ -1134,9 +1138,11 @@
    3.89          /// </summary>
    3.90          /// <param name="addressEntry">The address entry to get the own identity from.</param>
    3.91          /// <param name="ownIdentity">The output own identity (may be null).</param>
    3.92 +        /// <param name="updateOwnIdentity">Whether or not to call Myself to get the fingerprint.</param>
    3.93          /// <returns>The own identity or null.</returns>
    3.94          public static Globals.ReturnStatus GetOwnIdentity(Outlook.AddressEntry addressEntry,
    3.95 -                                                          out PEPIdentity ownIdentity)
    3.96 +                                                          out PEPIdentity ownIdentity,
    3.97 +                                                          bool updateOwnIdentity = false)
    3.98          {
    3.99              PEPIdentity ident = null;
   3.100              Outlook.ExchangeUser exchangeUser = null;
   3.101 @@ -1147,7 +1153,7 @@
   3.102                  try
   3.103                  {
   3.104                      // Try to get the identity directly from the address
   3.105 -                    status = PEPIdentity.GetOwnIdentity(addressEntry.Address, out ident);
   3.106 +                    status = PEPIdentity.GetOwnIdentity(addressEntry.Address, out ident, updateOwnIdentity);
   3.107  
   3.108                      // If unsuccessful, try backup method
   3.109                      if (ident == null)
   3.110 @@ -1158,7 +1164,7 @@
   3.111                              case Outlook.OlAddressEntryUserType.olExchangeRemoteUserAddressEntry:
   3.112                                  {
   3.113                                      exchangeUser = addressEntry.GetExchangeUser();
   3.114 -                                    status = PEPIdentity.GetOwnIdentity(exchangeUser.PrimarySmtpAddress, out ident);
   3.115 +                                    status = PEPIdentity.GetOwnIdentity(exchangeUser.PrimarySmtpAddress, out ident, updateOwnIdentity);
   3.116                                  }
   3.117                                  break;
   3.118                              case Outlook.OlAddressEntryUserType.olExchangeDistributionListAddressEntry:
   3.119 @@ -1202,9 +1208,11 @@
   3.120          /// </summary>
   3.121          /// <param name="account">The account to get the own identity from.</param>
   3.122          /// <param name="ownIdentity">The output own identity (may be null).</param>
   3.123 +        /// <param name="updateOwnIdentity">Whether or not to call Myself to get the fingerprint.</param>
   3.124          /// <returns>The own identity or null.</returns>
   3.125          public static Globals.ReturnStatus GetOwnIdentity(Outlook.Account account,
   3.126 -                                                          out PEPIdentity ownIdentity)
   3.127 +                                                          out PEPIdentity ownIdentity,
   3.128 +                                                          bool updateOwnIdentity = false)
   3.129          {
   3.130              PEPIdentity ident = null;
   3.131              Outlook.Recipient currUser = null;
   3.132 @@ -1215,13 +1223,13 @@
   3.133                  try
   3.134                  {
   3.135                      // Attempt to get the identity directly via SMTP address
   3.136 -                    status = PEPIdentity.GetOwnIdentity(account.SmtpAddress?.Trim(), out ident);
   3.137 +                    status = PEPIdentity.GetOwnIdentity(account.SmtpAddress?.Trim(), out ident, updateOwnIdentity);
   3.138  
   3.139                      // If the above method failed, try backup method
   3.140                      if (ident == null)
   3.141                      {
   3.142                          currUser = account.CurrentUser;
   3.143 -                        status = PEPIdentity.GetOwnIdentity(currUser, out ident);
   3.144 +                        status = PEPIdentity.GetOwnIdentity(currUser, out ident, updateOwnIdentity);
   3.145                      }
   3.146                  }
   3.147                  catch (Exception ex)
   3.148 @@ -1250,9 +1258,11 @@
   3.149          /// </summary>
   3.150          /// <param name="recipient">The recipient to get the own identity from.</param>
   3.151          /// <param name="ownIdentity">The output own identity (may be null).</param>
   3.152 +        /// <param name="updateOwnIdentity">Whether or not to call Myself to get the fingerprint.</param>
   3.153          /// <returns>The own identity or null.</returns>
   3.154          public static Globals.ReturnStatus GetOwnIdentity(Outlook.Recipient recipient,
   3.155 -                                                          out PEPIdentity ownIdentity)
   3.156 +                                                          out PEPIdentity ownIdentity,
   3.157 +                                                          bool updateOwnIdentity = false)
   3.158          {
   3.159              PEPIdentity ident = null;
   3.160              Outlook.AddressEntry addressEntry = null;
   3.161 @@ -1263,13 +1273,13 @@
   3.162                  try
   3.163                  {
   3.164                      // Try to get the identity directly from the address
   3.165 -                    status = PEPIdentity.GetOwnIdentity(recipient.Address, out ident);
   3.166 +                    status = PEPIdentity.GetOwnIdentity(recipient.Address, out ident, updateOwnIdentity);
   3.167  
   3.168                      // If unsuccessful, try backup method
   3.169                      if (ident == null)
   3.170                      {
   3.171                          addressEntry = recipient.AddressEntry;
   3.172 -                        status = PEPIdentity.GetOwnIdentity(addressEntry, out ident);
   3.173 +                        status = PEPIdentity.GetOwnIdentity(addressEntry, out ident, updateOwnIdentity);
   3.174                      }
   3.175                  }
   3.176                  catch (Exception ex)
     4.1 --- a/Properties/AssemblyInfo.cs	Fri Oct 05 14:27:03 2018 +0200
     4.2 +++ b/Properties/AssemblyInfo.cs	Mon Oct 08 13:38:44 2018 +0200
     4.3 @@ -14,6 +14,9 @@
     4.4  #if READER_RELEASE_MODE
     4.5  [assembly: AssemblyTitle("p≡p Reader for Outlook")]
     4.6  [assembly: AssemblyDescription("p≡p Reader for Outlook")]
     4.7 +#elif ENTERPRISE
     4.8 +[assembly: AssemblyTitle("p≡p for Outlook Enterprise")]
     4.9 +[assembly: AssemblyDescription("p≡p for Outlook Enterprise")]
    4.10  #else
    4.11  [assembly: AssemblyTitle("p≡p for Outlook")]
    4.12  [assembly: AssemblyDescription("p≡p for Outlook")]
     5.1 --- a/Properties/Resources.resx	Fri Oct 05 14:27:03 2018 +0200
     5.2 +++ b/Properties/Resources.resx	Mon Oct 08 13:38:44 2018 +0200
     5.3 @@ -539,7 +539,7 @@
     5.4      <value>No action needed!</value>
     5.5    </data>
     5.6    <data name="PrivacyStatus_RatingTrustedText" xml:space="preserve">
     5.7 -    <value>Secure &amp; Trusted</value>
     5.8 +    <value>Secure &amp;&amp; Trusted</value>
     5.9    </data>
    5.10    <data name="PrivacyStatus_RatingUndefinedExplanation" xml:space="preserve">
    5.11      <value>This message does not contain enough information to determine if it is secure.</value>
     6.1 --- a/pEpForOutlook.csproj	Fri Oct 05 14:27:03 2018 +0200
     6.2 +++ b/pEpForOutlook.csproj	Mon Oct 08 13:38:44 2018 +0200
     6.3 @@ -67,6 +67,11 @@
     6.4        <ProductName>Microsoft .NET Framework 4 Client Profile %28x86 and x64%29</ProductName>
     6.5        <Install>true</Install>
     6.6      </BootstrapperPackage>
     6.7 +    <BootstrapperPackage Include=".NETFramework,Version=v4.5">
     6.8 +      <Visible>False</Visible>
     6.9 +      <ProductName>Microsoft .NET Framework 4.5 %28x86 and x64%29</ProductName>
    6.10 +      <Install>true</Install>
    6.11 +    </BootstrapperPackage>
    6.12      <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
    6.13        <Visible>False</Visible>
    6.14        <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
    6.15 @@ -84,7 +89,7 @@
    6.16      </BootstrapperPackage>
    6.17      <BootstrapperPackage Include="Microsoft.VSTORuntime.4.0">
    6.18        <Visible>False</Visible>
    6.19 -      <ProductName>Microsoft Visual Studio 2010 Tools for Office Runtime %28x86 and x64%29</ProductName>
    6.20 +      <ProductName>Microsoft Visual Studio 2010-Tools für Office-Laufzeit %28x86 und x64%29</ProductName>
    6.21        <Install>true</Install>
    6.22      </BootstrapperPackage>
    6.23      <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
    6.24 @@ -162,6 +167,36 @@
    6.25      <Prefer32Bit>false</Prefer32Bit>
    6.26    </PropertyGroup>
    6.27    <!--
    6.28 +    This section defines properties that are set when the "Enterprise" configuration is selected.
    6.29 +
    6.30 +    DebugSymbols
    6.31 +      If "true", create symbols (.pdb). If "false", do not create symbols.
    6.32 +    DefineConstants
    6.33 +      Constants defined for the preprocessor.
    6.34 +    EnableUnmanagedDebugging
    6.35 +      If "true", starting the debugger will attach both managed and unmanaged debuggers.
    6.36 +    Optimize
    6.37 +      If "true", optimize the build output. If "false", do not optimize.
    6.38 +    OutputPath
    6.39 +      Output path of project relative to the project file.
    6.40 +    WarningLevel
    6.41 +      Warning level for the compiler.
    6.42 +  -->
    6.43 +  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Enterprise|AnyCPU' ">
    6.44 +    <DebugType>pdbonly</DebugType>
    6.45 +    <Optimize>true</Optimize>
    6.46 +    <OutputPath>bin\Release\</OutputPath>
    6.47 +    <EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
    6.48 +    <DefineConstants>$(DefineConstants);TRACE;ENTERPRISE</DefineConstants>
    6.49 +    <WarningLevel>4</WarningLevel>
    6.50 +    <RegisterForComInterop>false</RegisterForComInterop>
    6.51 +    <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
    6.52 +    <RunCodeAnalysis>true</RunCodeAnalysis>
    6.53 +    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
    6.54 +    <DebugSymbols>true</DebugSymbols>
    6.55 +    <Prefer32Bit>false</Prefer32Bit>
    6.56 +  </PropertyGroup>
    6.57 +  <!--
    6.58      This section defines properties that are set when the "ReaderRelease" configuration is selected.
    6.59  	This is a sub-set of the functionality int he Release configuration.
    6.60  	
    6.61 @@ -242,6 +277,10 @@
    6.62        <HintPath>..\Release\pEpCOMServerAdapter.Interop.dll</HintPath>
    6.63        <EmbedInteropTypes>False</EmbedInteropTypes>
    6.64      </Reference>
    6.65 +	    <Reference Include="pEpCOMServerAdapter.Interop" Condition="'$(Configuration)'=='Enterprise'">
    6.66 +      <HintPath>..\Release\pEpCOMServerAdapter.Interop.dll</HintPath>
    6.67 +      <EmbedInteropTypes>False</EmbedInteropTypes>
    6.68 +    </Reference>
    6.69      <Reference Include="PresentationCore" />
    6.70      <Reference Include="PresentationFramework" />
    6.71      <Reference Include="System" />