Skip to content
Permalink
Browse files

dhtrunner: use new push_token config option

  • Loading branch information...
aberaud committed Sep 30, 2019
1 parent ac10afa commit 9bc2ceca68974fc84953c12e94d8b248ff76a42d
Showing with 3 additions and 6 deletions.
  1. +0 −3 include/opendht/dhtrunner.h
  2. +3 −3 src/dhtrunner.cpp
@@ -516,9 +516,6 @@ class OPENDHT_PUBLIC DhtRunner {
status6 {NodeStatus::Disconnected};
StatusCallback statusCb {nullptr};

/** Push notification token */
std::string pushToken_;

/** PeerDiscovery Parameters */
std::shared_ptr<PeerDiscovery> peerDiscovery_;

@@ -993,8 +993,8 @@ DhtRunner::enableProxy(bool proxify)
);
dht_via_proxy_ = std::unique_ptr<SecureDht>(new SecureDht(std::move(dht_via_proxy), config_.dht_config));
#ifdef OPENDHT_PUSH_NOTIFICATIONS
if (not pushToken_.empty())
dht_via_proxy_->setPushNotificationToken(pushToken_);
if (not config_.push_token.empty())
dht_via_proxy_->setPushNotificationToken(config_.push_token);
#endif
// add current listeners
for (auto& l: listeners_)
@@ -1045,7 +1045,7 @@ void
DhtRunner::setPushNotificationToken(const std::string& token) {
std::lock_guard<std::mutex> lck(dht_mtx);
#if defined(OPENDHT_PROXY_CLIENT) && defined(OPENDHT_PUSH_NOTIFICATIONS)
pushToken_ = token;
config_.push_token = token;
if (dht_via_proxy_)
dht_via_proxy_->setPushNotificationToken(token);
#else

0 comments on commit 9bc2cec

Please sign in to comment.
You can’t perform that action at this time.