CpEpEngine.cpp
branchsync
changeset 307 eb5012d87405
parent 306 68a6adf189f8
child 308 0017f25f860d
     1.1 --- a/CpEpEngine.cpp	Mon Oct 22 10:59:28 2018 +0200
     1.2 +++ b/CpEpEngine.cpp	Mon Oct 22 17:54:28 2018 +0200
     1.3 @@ -736,12 +736,14 @@
     1.4      return _ident;
     1.5  }
     1.6  
     1.7 -PEP_STATUS CpEpEngine::_messageToSend(message *msg, bool in_sync)
     1.8 +PEP_STATUS CpEpEngine::messageToSend(message *msg)
     1.9  {
    1.10      assert(msg);
    1.11      if (!msg)
    1.12          return PEP_ILLEGAL_VALUE;
    1.13  
    1.14 +    bool in_sync = on_sync_thread();
    1.15 +
    1.16      for (auto p = sync_callbacks.begin(); p != sync_callbacks.end(); ++p) {
    1.17          IpEpEngineCallbacks *cb;
    1.18          if (in_sync)
    1.19 @@ -767,22 +769,14 @@
    1.20      return PEP_STATUS_OK;
    1.21  }
    1.22  
    1.23 -PEP_STATUS CpEpEngine::messageToSend(message *msg)
    1.24 -{
    1.25 -    return _messageToSend(msg);
    1.26 -}
    1.27 -
    1.28 -PEP_STATUS CpEpEngine::messageToSend_sync(message *msg)
    1.29 -{
    1.30 -    return _messageToSend(msg, true);
    1.31 -}
    1.32 -
    1.33 -PEP_STATUS CpEpEngine::_notifyHandshake(::pEp_identity *self, ::pEp_identity *partner, sync_handshake_signal signal, bool in_sync)
    1.34 +PEP_STATUS CpEpEngine::notifyHandshake(::pEp_identity *self, ::pEp_identity *partner, sync_handshake_signal signal)
    1.35  {
    1.36      assert(self && partner);
    1.37      if (!(self && partner))
    1.38          return PEP_ILLEGAL_VALUE;
    1.39  
    1.40 +    bool in_sync = on_sync_thread();
    1.41 +
    1.42      // fire all of them
    1.43      for (auto p = sync_callbacks.begin(); p != sync_callbacks.end(); ++p) {
    1.44          IpEpEngineCallbacks *cb;
    1.45 @@ -811,16 +805,6 @@
    1.46      return PEP_STATUS_OK;
    1.47  }
    1.48  
    1.49 -PEP_STATUS CpEpEngine::notifyHandshake(::pEp_identity *self, ::pEp_identity *partner, sync_handshake_signal signal)
    1.50 -{
    1.51 -    return _notifyHandshake(self, partner, signal);
    1.52 -}
    1.53 -
    1.54 -PEP_STATUS CpEpEngine::notifyHandshake_sync(::pEp_identity *self, ::pEp_identity *partner, sync_handshake_signal signal)
    1.55 -{
    1.56 -    return _notifyHandshake(self, partner, signal, true);
    1.57 -}
    1.58 -
    1.59  STDMETHODIMP CpEpEngine::BlacklistAdd(BSTR fpr)
    1.60  {
    1.61      assert(fpr);