OUT-572: Fix calaculation of rating when recipient or sender changes sync
authorThomas
Tue, 11 Jun 2019 14:05:22 +0200
branchsync
changeset 266280601ae81dd2
parent 2661 e90dfa2ce8f0
child 2663 269595c41be5
child 2664 c8588860ae75
child 2666 6e23630511c3
OUT-572: Fix calaculation of rating when recipient or sender changes
CryptableMailItem.cs
Wrappers/WatchedWindow.cs
     1.1 --- a/CryptableMailItem.cs	Fri Jun 07 14:52:25 2019 +0200
     1.2 +++ b/CryptableMailItem.cs	Tue Jun 11 14:05:22 2019 +0200
     1.3 @@ -1621,7 +1621,9 @@
     1.4                      return true;
     1.5                  });
     1.6  
     1.7 -                if (process)
     1.8 +                // Process (and doublecheck if processor is still not busy)
     1.9 +                if (process &&
    1.10 +                    (this.processor.IsBusy == false))
    1.11                  {
    1.12                      this.processor.RunWorkerAsync(entryId);
    1.13                  }
     2.1 --- a/Wrappers/WatchedWindow.cs	Fri Jun 07 14:52:25 2019 +0200
     2.2 +++ b/Wrappers/WatchedWindow.cs	Tue Jun 11 14:05:22 2019 +0200
     2.3 @@ -979,6 +979,7 @@
     2.4  
     2.5                      // Connect refresh timer
     2.6                      this.TimerRefresh.Tick += TimerRefresh_Tick;
     2.7 +                    this.TimerRefresh.Start();
     2.8                      this.isStarted = true;
     2.9                  }
    2.10              }
    2.11 @@ -992,6 +993,12 @@
    2.12                      this.TimerRefresh.Tick -= TimerRefresh_Tick;
    2.13                  }
    2.14  
    2.15 +                // For draft messages, just set rating to unencrypted if pEp is not enabled
    2.16 +                if (this.IsDraft)
    2.17 +                {
    2.18 +                    this.SetRating(pEpRating.pEpRatingUnencrypted);
    2.19 +                }
    2.20 +
    2.21                  this.isStarted = false;
    2.22              }
    2.23          }
    2.24 @@ -1439,8 +1446,6 @@
    2.25                          this.SetIsEnabled((this.CurrentMailItem)?.GetEnableFormRegion() ?? false);
    2.26  
    2.27                          // Refresh the UI
    2.28 -                        this.ResolveAllRecipients();
    2.29 -                        this.RequestRatingAndUIUpdate();
    2.30                          RibbonCustomizations.Invalidate();
    2.31  
    2.32                          break;
    2.33 @@ -1500,7 +1505,7 @@
    2.34  #pragma warning disable 219
    2.35              bool markForDownload = false;
    2.36  #pragma warning restore 219
    2.37 -            this.TimerRefresh.Enabled = false; // Only once
    2.38 +            this.TimerRefresh.Stop(); // Only once
    2.39              Outlook.OlDownloadState dlState;
    2.40  
    2.41              /* The Refresh/UI_Update process: