Merge with sync OUT-640
authorThomas
Fri, 22 Nov 2019 11:02:35 +0100
branchOUT-640
changeset 2880fef4fae188c4
parent 2877 68bd0540f1b8
parent 2879 61d9e3364dc0
child 2881 1b675247812e
Merge with sync
     1.1 --- a/PEPIdentity.cs	Thu Nov 21 17:25:36 2019 +0100
     1.2 +++ b/PEPIdentity.cs	Fri Nov 22 11:02:35 2019 +0100
     1.3 @@ -58,7 +58,8 @@
     1.4          {
     1.5              this.internalIdentity = new pEpIdentity
     1.6              {
     1.7 -                Address = address
     1.8 +                Address = address,
     1.9 +                Me = Convert.ToInt16(PEPIdentity.GetIsOwnIdentity(address))
    1.10              };
    1.11              this._IsForceUnencrypted = null;
    1.12              this._IsSmartAddressEnabled = true;
    1.13 @@ -175,17 +176,6 @@
    1.14                  this.RaisePropertyChangedEvent(nameof(this.IsList));
    1.15              }
    1.16          }
    1.17 -
    1.18 -        /// <summary>
    1.19 -        /// Gets whether an identity is an own identity.
    1.20 -        /// </summary>
    1.21 -        public bool IsOwnIdentity
    1.22 -        {
    1.23 -            get
    1.24 -            {
    1.25 -                return Convert.ToBoolean(this.internalIdentity.Me);
    1.26 -            }
    1.27 -        }
    1.28              
    1.29  
    1.30          /// <summary>
    1.31 @@ -224,6 +214,19 @@
    1.32          }
    1.33  
    1.34          /// <summary>
    1.35 +        /// Gets whether an identity is an own identity.
    1.36 +        /// </summary>
    1.37 +        public bool Me
    1.38 +        {
    1.39 +            get { return Convert.ToBoolean(this.internalIdentity.Me); }
    1.40 +            set
    1.41 +            {
    1.42 +                this.internalIdentity.Me = Convert.ToInt16(value);
    1.43 +                this.RaisePropertyChangedEvent(nameof(this.Me));
    1.44 +            }
    1.45 +        }
    1.46 +
    1.47 +        /// <summary>
    1.48          /// Gets or sets a unique user ID for the identity.
    1.49          /// </summary>
    1.50          public string UserId
    1.51 @@ -512,6 +515,7 @@
    1.52                  fpr = this.internalIdentity.fpr,
    1.53                  Flags = this.internalIdentity.Flags,
    1.54                  lang = this.internalIdentity.lang,
    1.55 +                Me = this.internalIdentity.Me,
    1.56                  UserId = this.internalIdentity.UserId,
    1.57                  UserName = this.internalIdentity.UserName
    1.58              };
    1.59 @@ -558,6 +562,7 @@
    1.60                  Comparisons.Equals(this.CommunicationType, obj.CommunicationType) &&
    1.61                  Comparisons.Equals(this.Fingerprint, obj.Fingerprint) &&
    1.62                  Comparisons.Equals(this.Language, obj.Language) &&
    1.63 +                Comparisons.Equals(this.Me, obj.Me) &&
    1.64                  Comparisons.Equals(this.UserId, obj.UserId) &&
    1.65                  Comparisons.Equals(this.UserName, obj.UserName) &&
    1.66                  Comparisons.Equals(this.IsForceUnencrypted, obj.IsForceUnencrypted) &&
    1.67 @@ -586,6 +591,7 @@
    1.68                  IsList = this.internalIdentity.GetIsList(),
    1.69                  IsSyncEnabled = this.internalIdentity.GetIsSyncEnabled(),
    1.70                  Language = (this.internalIdentity.lang == null ? null : string.Copy(this.internalIdentity.lang)),
    1.71 +                Me = Convert.ToBoolean(this.internalIdentity.Me),
    1.72                  UserId = (this.internalIdentity.UserId == null ? null : string.Copy(this.internalIdentity.UserId)),
    1.73                  UserName = (this.internalIdentity.UserName == null ? null : string.Copy(this.internalIdentity.UserName))
    1.74              };
    1.75 @@ -944,7 +950,8 @@
    1.76                      {
    1.77                          Address = settings.SmtpAddress,
    1.78                          UserName = settings.UserName,
    1.79 -                        UserId = PEPSettings.PEP_OWN_USER_ID
    1.80 +                        UserId = PEPSettings.PEP_OWN_USER_ID,
    1.81 +                        Me = true,
    1.82                      };
    1.83  
    1.84                      if (updateOwnIdentity)
     2.1 --- a/UI/ViewModels/HandshakeViewModel.cs	Thu Nov 21 17:25:36 2019 +0100
     2.2 +++ b/UI/ViewModels/HandshakeViewModel.cs	Fri Nov 22 11:02:35 2019 +0100
     2.3 @@ -459,7 +459,7 @@
     2.4              this.SetExplanationText();
     2.5  
     2.6              // Define visibility of Reset button
     2.7 -            this.IsResetButtonVisible = (this.Parent.Dialog.DialogType == Dialog.Type.Handshake) && (this.Partner.IsOwnIdentity == false);
     2.8 +            this.IsResetButtonVisible = (this.Parent.Dialog.DialogType == Dialog.Type.Handshake) && (this.Partner.Me == false);
     2.9          }
    2.10  
    2.11          /// <summary>