UI/Models/Dialog.cs
branchsync
changeset 2829 cf97661db398
parent 2789 04b1369a0456
child 2835 417b06496e98
equal deleted inserted replaced
2825:40095ddda050 2829:cf97661db398
   115                 PEPIdentity identity = identities[i];
   115                 PEPIdentity identity = identities[i];
   116                 try
   116                 try
   117                 {
   117                 {
   118                     pEpIdentity _identity = identity.ToCOMType();
   118                     pEpIdentity _identity = identity.ToCOMType();
   119                     _identity = ThisAddIn.PEPEngine.UpdateIdentity(_identity);
   119                     _identity = ThisAddIn.PEPEngine.UpdateIdentity(_identity);
   120                     identity = new PEPIdentity(_identity);
   120                     identity = new PEPIdentity(_identity)
       
   121                     {
       
   122                         Rating = ThisAddIn.PEPEngine.RatingFromCommType(_identity.CommType)
       
   123                     };
   121 
   124 
   122                 }
   125                 }
   123                 catch (Exception ex)
   126                 catch (Exception ex)
   124                 {
   127                 {
   125                     Log.Error("Dialog.Ctr: Error updating partner. " + ex.ToString());
   128                     Log.Error("Dialog.Ctr: Error updating partner. " + ex.ToString());
   126                 }
   129                 }
   127 
   130 
   128                 // Determine the partner's rating
       
   129                 if (identity?.Fingerprint != null)
       
   130                 {
       
   131                     try
       
   132                     {
       
   133                         pEpRating rating = ThisAddIn.PEPEngine.GetKeyRatingForUser(identity.UserId, identity.Fingerprint);
       
   134                         identity.Rating = rating;
       
   135                     }
       
   136                     catch (Exception ex)
       
   137                     {
       
   138                         Log.Error("Dialog.Ctr: Error getting partner rating. " + ex.ToString());
       
   139                     }
       
   140                 }
       
   141 
       
   142                 identities[i] = identity;
   131                 identities[i] = identity;
   143             }
   132             }
   144         }
   133         }
   145     }
   134     }
   146 }
   135 }