From 4261bd2c85480da25a4218a657d93bbf02f454fc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com>
Date: Fri, 9 Mar 2018 10:54:40 -0500
Subject: [PATCH] dhtinterface: remove resubscribe

---
 include/opendht/dht_interface.h | 5 -----
 include/opendht/dhtrunner.h     | 5 -----
 include/opendht/securedht.h     | 7 -------
 src/dhtrunner.cpp               | 9 ---------
 tools/dhtnode.cpp               | 7 -------
 5 files changed, 33 deletions(-)

diff --git a/include/opendht/dht_interface.h b/include/opendht/dht_interface.h
index 7f364196..a312a4c6 100644
--- a/include/opendht/dht_interface.h
+++ b/include/opendht/dht_interface.h
@@ -235,11 +235,6 @@ public:
      * @param notification to process
      */
     virtual void pushNotificationReceived(const std::map<std::string, std::string>& data) = 0;
-    /**
-     * Refresh a listen via a token
-     * @param token
-     */
-    virtual void resubscribe(unsigned token) = 0;
 
 protected:
     bool logFilerEnable_ {};
diff --git a/include/opendht/dhtrunner.h b/include/opendht/dhtrunner.h
index 8685acac..89090330 100644
--- a/include/opendht/dhtrunner.h
+++ b/include/opendht/dhtrunner.h
@@ -400,11 +400,6 @@ public:
      * Insert a push notification to process for OpenDHT
      */
     void pushNotificationReceived(const std::map<std::string, std::string>& data) const;
-    /**
-     * Refresh a listen via a token
-     * @param token
-     */
-    void resubscribe(unsigned token);
 
     /* Proxy server mothods */
     void forwardAllMessages(bool forward);
diff --git a/include/opendht/securedht.h b/include/opendht/securedht.h
index 7d300fba..e1d31a9a 100644
--- a/include/opendht/securedht.h
+++ b/include/opendht/securedht.h
@@ -308,13 +308,6 @@ public:
     void pushNotificationReceived(const std::map<std::string, std::string>& notification) {
         dht_->pushNotificationReceived(notification);
     }
-    /**
-     * Refresh a listen via a token
-     * @param token
-     */
-    void resubscribe(const unsigned token) {
-        dht_->resubscribe(token);
-    }
 
     void setLoggers(LogMethod error = NOLOG, LogMethod warn = NOLOG, LogMethod debug = NOLOG)
     {
diff --git a/src/dhtrunner.cpp b/src/dhtrunner.cpp
index 5f8ac96f..892fd111 100644
--- a/src/dhtrunner.cpp
+++ b/src/dhtrunner.cpp
@@ -952,13 +952,4 @@ DhtRunner::pushNotificationReceived(const std::map<std::string, std::string>& da
 #endif
 }
 
-void
-DhtRunner::resubscribe(unsigned token)
-{
-#if OPENDHT_PROXY_CLIENT && OPENDHT_PUSH_NOTIFICATIONS
-    if (dht_via_proxy_)
-        dht_via_proxy_->resubscribe(token);
-#endif
-}
-
 }
diff --git a/tools/dhtnode.cpp b/tools/dhtnode.cpp
index 0c12df62..7f0a95b8 100644
--- a/tools/dhtnode.cpp
+++ b/tools/dhtnode.cpp
@@ -232,13 +232,6 @@ void cmd_loop(std::shared_ptr<DhtRunner>& dht, dht_params& params
             iss >> value;
             dht->pushNotificationReceived({{"token", value}});
             continue;
-        } else if (op == "re") {
-            iss >> value;
-            try {
-                unsigned token = std::stoul(value);
-                dht->resubscribe(token);
-            } catch (...) { }
-            continue;
         }
 #endif // OPENDHT_PUSH_NOTIFICATIONS
 #endif //OPENDHT_PROXY_CLIENT
-- 
GitLab