Add adapter method to query if sync is running sync
authorThomas
Wed, 20 Nov 2019 17:20:07 +0100
branchsync
changeset 28756b75679c8b61
parent 2874 92899af51bca
child 2876 ddf5f79fd0ac
child 2878 bb83a7935016
Add adapter method to query if sync is running
AdapterExtensions.cs
MsgProcessor.cs
     1.1 --- a/AdapterExtensions.cs	Wed Nov 20 09:52:21 2019 +0100
     1.2 +++ b/AdapterExtensions.cs	Wed Nov 20 17:20:07 2019 +0100
     1.3 @@ -19,6 +19,27 @@
     1.4           *************************************************************/
     1.5  
     1.6          /// <summary>
     1.7 +        /// Gets whether Sync is enabled in the adapter.
     1.8 +        /// </summary>
     1.9 +        /// <returns>True if sync is enabled. Otherwise false.</returns>
    1.10 +        public static bool GetIsSyncEnabled()
    1.11 +        {
    1.12 +            bool enabled = false;
    1.13 +
    1.14 +            try
    1.15 +            {
    1.16 +                enabled = ThisAddIn.PEPEngine.GetIsSyncRunning();
    1.17 +            }
    1.18 +            catch (Exception ex)
    1.19 +            {
    1.20 +                enabled = false;
    1.21 +                Log.Error("GetIsSyncEnabled: Error occured. " + ex.ToString());
    1.22 +            }
    1.23 +
    1.24 +            return enabled;
    1.25 +        }
    1.26 +
    1.27 +        /// <summary>
    1.28          /// Gets the Trustwords for the two given identities.
    1.29          /// This will never return null.
    1.30          /// </summary>
    1.31 @@ -48,7 +69,7 @@
    1.32              catch (COMException ex)
    1.33              {
    1.34                  trustwords = string.Empty;
    1.35 -                Log.Error("GetTrustwords: Failure occured with account: id1 - " + id1?.Address+ ", id2 - " + id2?.Address + ". " + ex.ToString());
    1.36 +                Log.Error("GetTrustwords: Failure occured with account: id1 - " + id1?.Address + ", id2 - " + id2?.Address + ". " + ex.ToString());
    1.37              }
    1.38              catch (Exception ex)
    1.39              {
     2.1 --- a/MsgProcessor.cs	Wed Nov 20 09:52:21 2019 +0100
     2.2 +++ b/MsgProcessor.cs	Wed Nov 20 17:20:07 2019 +0100
     2.3 @@ -11,11 +11,6 @@
     2.4      /// </summary>
     2.5      internal class MsgProcessor
     2.6      {
     2.7 -        /// <summary>
     2.8 -        /// Event handler for when a sync message is being detected during decryption.
     2.9 -        /// </summary>
    2.10 -        public delegate void SyncMessageReceivedHandler(object sender, MsgProcessor.SyncMessageEventArgs e);
    2.11 -        public static event SyncMessageReceivedHandler SyncMessageReceived;
    2.12  
    2.13          /**************************************************************
    2.14           *