Use RatingFromCommType sync
authorThomas
Thu, 24 Oct 2019 11:54:07 +0200
branchsync
changeset 2829cf97661db398
parent 2825 40095ddda050
child 2835 417b06496e98
Use RatingFromCommType
UI/Models/Dialog.cs
UI/ViewModels/HandshakeViewModel.cs
     1.1 --- a/UI/Models/Dialog.cs	Wed Oct 23 13:14:06 2019 +0200
     1.2 +++ b/UI/Models/Dialog.cs	Thu Oct 24 11:54:07 2019 +0200
     1.3 @@ -117,7 +117,10 @@
     1.4                  {
     1.5                      pEpIdentity _identity = identity.ToCOMType();
     1.6                      _identity = ThisAddIn.PEPEngine.UpdateIdentity(_identity);
     1.7 -                    identity = new PEPIdentity(_identity);
     1.8 +                    identity = new PEPIdentity(_identity)
     1.9 +                    {
    1.10 +                        Rating = ThisAddIn.PEPEngine.RatingFromCommType(_identity.CommType)
    1.11 +                    };
    1.12  
    1.13                  }
    1.14                  catch (Exception ex)
    1.15 @@ -125,20 +128,6 @@
    1.16                      Log.Error("Dialog.Ctr: Error updating partner. " + ex.ToString());
    1.17                  }
    1.18  
    1.19 -                // Determine the partner's rating
    1.20 -                if (identity?.Fingerprint != null)
    1.21 -                {
    1.22 -                    try
    1.23 -                    {
    1.24 -                        pEpRating rating = ThisAddIn.PEPEngine.GetKeyRatingForUser(identity.UserId, identity.Fingerprint);
    1.25 -                        identity.Rating = rating;
    1.26 -                    }
    1.27 -                    catch (Exception ex)
    1.28 -                    {
    1.29 -                        Log.Error("Dialog.Ctr: Error getting partner rating. " + ex.ToString());
    1.30 -                    }
    1.31 -                }
    1.32 -
    1.33                  identities[i] = identity;
    1.34              }
    1.35          }
     2.1 --- a/UI/ViewModels/HandshakeViewModel.cs	Wed Oct 23 13:14:06 2019 +0200
     2.2 +++ b/UI/ViewModels/HandshakeViewModel.cs	Thu Oct 24 11:54:07 2019 +0200
     2.3 @@ -646,7 +646,7 @@
     2.4                  identity = ThisAddIn.PEPEngine.UpdateIdentity(identity);
     2.5                  this.Partner = new PEPIdentity(identity)
     2.6                  {
     2.7 -                    Rating = string.IsNullOrEmpty(identity.fpr) ? pEpRating.pEpRatingUnencrypted : ThisAddIn.PEPEngine.GetKeyRatingForUser(identity.UserId, identity.fpr)
     2.8 +                    Rating = ThisAddIn.PEPEngine.RatingFromCommType(identity.CommType)
     2.9                  };
    2.10  
    2.11                  // Update view