From 177ca9505775df4f6b790408d0b4d9370cae4fb7 Mon Sep 17 00:00:00 2001 From: Volker Birk Date: Wed, 1 Jul 2020 11:23:39 +0200 Subject: [PATCH 1/2] ... --- callback_dispatcher.cc | 2 +- callback_dispatcher.hh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/callback_dispatcher.cc b/callback_dispatcher.cc index c90cf0f..16b066f 100644 --- a/callback_dispatcher.cc +++ b/callback_dispatcher.cc @@ -2,7 +2,7 @@ #include #include -pEp::CallbackDispatcher callback_dispatcher; +pEp::CallbackDispatcher pEp::callback_dispatcher; namespace pEp { bool CallbackDispatcher::once = true; diff --git a/callback_dispatcher.hh b/callback_dispatcher.hh index f858403..785eec9 100644 --- a/callback_dispatcher.hh +++ b/callback_dispatcher.hh @@ -50,6 +50,6 @@ namespace pEp { ::pEp_identity *partner, ::sync_handshake_signal signal); }; + extern CallbackDispatcher callback_dispatcher; }; -extern pEp::CallbackDispatcher callback_dispatcher; From 27a2c5519619615df5beab57655dacceefa5747c Mon Sep 17 00:00:00 2001 From: Volker Birk Date: Wed, 1 Jul 2020 12:57:27 +0200 Subject: [PATCH 2/2] these two go static --- callback_dispatcher.cc | 6 +++--- callback_dispatcher.hh | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/callback_dispatcher.cc b/callback_dispatcher.cc index 16b066f..89e64c9 100644 --- a/callback_dispatcher.cc +++ b/callback_dispatcher.cc @@ -62,11 +62,11 @@ namespace pEp { void CallbackDispatcher::start_sync() { pEp::Adapter::startup(CallbackDispatcher::messageToSend, - CallbackDispatcher::notifyHandshake, this, + CallbackDispatcher::notifyHandshake, &callback_dispatcher, &CallbackDispatcher::on_startup, &CallbackDispatcher::on_shutdown); - for (auto target : targets) + for (auto target : callback_dispatcher.targets) target.notifyHandshake(nullptr, nullptr, SYNC_NOTIFY_START); } @@ -74,7 +74,7 @@ namespace pEp { { pEp::Adapter::shutdown(); - for (auto target : targets) + for (auto target : callback_dispatcher.targets) target.notifyHandshake(nullptr, nullptr, SYNC_NOTIFY_STOP); } diff --git a/callback_dispatcher.hh b/callback_dispatcher.hh index 785eec9..c6a4e11 100644 --- a/callback_dispatcher.hh +++ b/callback_dispatcher.hh @@ -34,8 +34,8 @@ namespace pEp { ); void remove(::messageToSend_t messageToSend); - void start_sync(); - void stop_sync(); + static void start_sync(); + static void stop_sync(); static PEP_STATUS messageToSend(::message *msg); static PEP_STATUS notifyHandshake(::pEp_identity *me,