trying out quicker preview preview_rating
authorVolker Birk <vb@pep.foundation>
Tue, 20 Mar 2018 15:55:51 +0100
branchpreview_rating
changeset 2072adf568e91939
parent 2062 959858ccbf5d
trying out quicker preview
PEPMessage.cs
UI/FormRegionPrivacyStatus.cs
     1.1 --- a/PEPMessage.cs	Thu Mar 15 14:14:33 2018 +0100
     1.2 +++ b/PEPMessage.cs	Tue Mar 20 15:55:51 2018 +0100
     1.3 @@ -458,7 +458,8 @@
     1.4  
     1.5                      try
     1.6                      {
     1.7 -                        rating = ThisAddIn.PEPEngine.OutgoingMessageRating(workingMessage.ToCOMType());
     1.8 +                        TextMessage msg = workingMessage.ToCOMType();
     1.9 +                        rating = ThisAddIn.PEPEngine.OutgoingMessageRating(msg);
    1.10                      }
    1.11                      catch (Exception ex)
    1.12                      {
     2.1 --- a/UI/FormRegionPrivacyStatus.cs	Thu Mar 15 14:14:33 2018 +0100
     2.2 +++ b/UI/FormRegionPrivacyStatus.cs	Tue Mar 20 15:55:51 2018 +0100
     2.3 @@ -1370,6 +1370,8 @@
     2.4              return;
     2.5          }
     2.6  
     2.7 +        bool first_to_check = true;
     2.8 +
     2.9          /// <summary>
    2.10          /// Event handler for when a mail item property is changed.
    2.11          /// See: https://msdn.microsoft.com/en-us/library/office/ff866739.aspx
    2.12 @@ -1410,6 +1412,19 @@
    2.13                      {
    2.14                          if (this.isEnabled)
    2.15                          {
    2.16 +                            if (first_to_check)
    2.17 +                            {
    2.18 +                                first_to_check = false;
    2.19 +                                try
    2.20 +                                {
    2.21 +                                    PEPIdentity ident = new PEPIdentity(this.cryptableMailItem.Recipients[0].Address);
    2.22 +                                    ident.UserId = this.cryptableMailItem.Recipients[0].UserId;
    2.23 +                                    pEpIdentity _ident = ident.ToCOMType();
    2.24 +                                    pEpRating rating = ThisAddIn.PEPEngine.PreviewRating(ref _ident);
    2.25 +                                    this.SetRating(rating);
    2.26 +                                }
    2.27 +                                catch { }
    2.28 +                            }
    2.29                              this.RequestRatingAndUIUpdate();
    2.30                          }
    2.31                          break;