dhtrunner: use new push_token config option

This commit is contained in:
Adrien Béraud committed 2019-09-30 10:52:50 -04:00
1 parent ac10afac44
commit 9bc2ceca68
2 files changed
+3 -6

No files matched your search

-3
View File
@@ -516,9 +516,6 @@ private:
status6 {NodeStatus::Disconnected};
StatusCallback statusCb {nullptr};
/** Push notification token */
std::string pushToken_;
/** PeerDiscovery Parameters */
std::shared_ptr<PeerDiscovery> peerDiscovery_;
+3 -3
View File
@@ -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