Remove unused callback sync
authorThomas
Mon, 29 Apr 2019 13:55:15 +0200
branchsync
changeset 262104d3ed8778d1
parent 2620 055a316b8ff8
child 2622 ed338b3729ab
Remove unused callback
AdapterCallbacks.cs
     1.1 --- a/AdapterCallbacks.cs	Wed Apr 24 16:55:52 2019 +0200
     1.2 +++ b/AdapterCallbacks.cs	Mon Apr 29 13:55:15 2019 +0200
     1.3 @@ -144,70 +144,6 @@
     1.4  
     1.5              return;
     1.6          }
     1.7 -
     1.8 -        /// <summary>
     1.9 -        /// Event handler for when the engine requests fast polling during keysync.
    1.10 -        /// </summary>
    1.11 -        /// <param name="enableFastPolling">Whether to enable or disable fast polling.</param>
    1.12 -        public void NeedFastPolling(bool enableFastPolling)
    1.13 -        {
    1.14 -            int counter = 0;
    1.15 -            Outlook.NameSpace ns = null;
    1.16 -
    1.17 -            if (enableFastPolling)
    1.18 -            {
    1.19 -                // Enable also the automatic cleaning of key sync messages
    1.20 -                try
    1.21 -                {
    1.22 -                    Globals.ThisAddIn.ToggleInboxCleaning(true);
    1.23 -                }
    1.24 -                catch { }
    1.25 -
    1.26 -                Log.Verbose("NeedFastPolling: Enabling fast polling.");
    1.27 -
    1.28 -                try
    1.29 -                {
    1.30 -                    timer = new System.Windows.Forms.Timer
    1.31 -                    {
    1.32 -                        Interval = FAST_POLLING_INTERVAL
    1.33 -                    };
    1.34 -                    timer.Tick += (s, e) =>
    1.35 -                    {
    1.36 -                        if (counter++ < MAX_POLLING_COUNT)
    1.37 -                        {
    1.38 -                            try
    1.39 -                            {
    1.40 -                                ns = Globals.ThisAddIn?.Application?.Session;
    1.41 -                                ns?.SendAndReceive(false);
    1.42 -                            }
    1.43 -                            catch (Exception ex)
    1.44 -                            {
    1.45 -                                Log.Error("NeedFastPolling: Error during polling. " + ex.Message);
    1.46 -                            }
    1.47 -                            finally
    1.48 -                            {
    1.49 -                                ns = null;
    1.50 -                            }
    1.51 -                        }
    1.52 -                    };
    1.53 -                    timer.Start();
    1.54 -                }
    1.55 -                catch (Exception ex)
    1.56 -                {
    1.57 -                    Log.Verbose("NeedFastPolling: Error occured. " + ex.ToString());
    1.58 -                    timer?.Stop();
    1.59 -                    timer?.Dispose();
    1.60 -                    timer = null;
    1.61 -                }
    1.62 -            }
    1.63 -            else
    1.64 -            {
    1.65 -                Log.Verbose("NeedFastPolling: Disabling fast polling.");
    1.66 -                timer?.Stop();
    1.67 -                timer?.Dispose();
    1.68 -                timer = null;
    1.69 -            }
    1.70 -        }
    1.71          #endregion
    1.72  
    1.73          #region Helper methods
    1.74 @@ -256,7 +192,7 @@
    1.75                          }
    1.76                  }
    1.77  
    1.78 -                ThisAddIn.PEPEngine.DeliverHandshakeResult(handshakeResult, new pEpIdentity[] { partner });
    1.79 +                ThisAddIn.PEPEngine.DeliverHandshakeResult(handshakeResult, new pEpIdentity[] { own });
    1.80              }
    1.81          }
    1.82