OUT-428: Restrict list of received sync message to 5
authorThomas
Fri, 18 May 2018 09:36:07 +0200
changeset 2203eb3db8f1ec68
parent 2202 27584ccea6f4
child 2204 94aaeb734ef2
OUT-428: Restrict list of received sync message to 5
UI/KeySyncWizard.xaml.cs
     1.1 --- a/UI/KeySyncWizard.xaml.cs	Fri May 18 09:28:27 2018 +0200
     1.2 +++ b/UI/KeySyncWizard.xaml.cs	Fri May 18 09:36:07 2018 +0200
     1.3 @@ -238,11 +238,6 @@
     1.4          }
     1.5  
     1.6          /// <summary>
     1.7 -        /// Gets or sets the success state.
     1.8 -        /// </summary>
     1.9 -
    1.10 -
    1.11 -        /// <summary>
    1.12          /// Gets or sets the wizard type.
    1.13          /// </summary>
    1.14          public WizardType Type
    1.15 @@ -560,6 +555,7 @@
    1.16               *      b. WizardType is pEp, the current step is Step 2 and the
    1.17               *         message hasn't been sent from myself
    1.18               *  2. Message is not in the list yet
    1.19 +             *  3. List has max 5 items
    1.20               */
    1.21              lock (mutexReceivedSyncMessages)
    1.22              {
    1.23 @@ -568,7 +564,8 @@
    1.24                       ((this.Type == WizardType.pEp) &&
    1.25                        (this.Step == Steps.Step2) &&
    1.26                        (this.Myself?.Fingerprint?.Equals(message?.KeyImport) == false))) &&
    1.27 -                    (this.receivedSyncMessages?.Find(a => (a.Id?.Equals(message.Id) == true)) == null))
    1.28 +                    (this.receivedSyncMessages?.Find(a => (a.Id?.Equals(message.Id) == true)) == null) &&
    1.29 +                    (this.receivedSyncMessages?.Count <= 5))
    1.30                  {
    1.31                      this.receivedSyncMessages?.Add(message);
    1.32                  }