OUT-428: Restrict list of received sync message to 5
authorThomas
Fri, 18 May 2018 09:36:07 +0200
changeset 2203 eb3db8f1ec68
parent 2202 27584ccea6f4
child 2204 94aaeb734ef2
OUT-428: Restrict list of received sync message to 5
UI/KeySyncWizard.xaml.cs
--- a/UI/KeySyncWizard.xaml.cs	Fri May 18 09:28:27 2018 +0200
+++ b/UI/KeySyncWizard.xaml.cs	Fri May 18 09:36:07 2018 +0200
@@ -238,11 +238,6 @@
         }
 
         /// <summary>
-        /// Gets or sets the success state.
-        /// </summary>
-
-
-        /// <summary>
         /// Gets or sets the wizard type.
         /// </summary>
         public WizardType Type
@@ -560,6 +555,7 @@
              *      b. WizardType is pEp, the current step is Step 2 and the
              *         message hasn't been sent from myself
              *  2. Message is not in the list yet
+             *  3. List has max 5 items
              */
             lock (mutexReceivedSyncMessages)
             {
@@ -568,7 +564,8 @@
                      ((this.Type == WizardType.pEp) &&
                       (this.Step == Steps.Step2) &&
                       (this.Myself?.Fingerprint?.Equals(message?.KeyImport) == false))) &&
-                    (this.receivedSyncMessages?.Find(a => (a.Id?.Equals(message.Id) == true)) == null))
+                    (this.receivedSyncMessages?.Find(a => (a.Id?.Equals(message.Id) == true)) == null) &&
+                    (this.receivedSyncMessages?.Count <= 5))
                 {
                     this.receivedSyncMessages?.Add(message);
                 }