diff --git a/retroshare-gui/src/util/TokenQueue.cpp b/retroshare-gui/src/util/TokenQueue.cpp index 8d114e95f..f62f00ca9 100644 --- a/retroshare-gui/src/util/TokenQueue.cpp +++ b/retroshare-gui/src/util/TokenQueue.cpp @@ -209,6 +209,18 @@ void TokenQueue::activeRequestTokens(const uint32_t& userType, std::list tokens; + activeRequestTokens(userType, tokens); + if (!tokens.empty()) { + std::list::iterator tokenIt; + for (tokenIt = tokens.begin(); tokenIt != tokens.end(); ++tokenIt) { + cancelRequest(*tokenIt); + } + } +} + void TokenQueue::loadRequest(const TokenRequest &req) { std::cerr << "TokenQueue::loadRequest(): "; diff --git a/retroshare-gui/src/util/TokenQueue.h b/retroshare-gui/src/util/TokenQueue.h index ba9b5929a..16e212832 100644 --- a/retroshare-gui/src/util/TokenQueue.h +++ b/retroshare-gui/src/util/TokenQueue.h @@ -99,8 +99,9 @@ public: bool checkForRequest(uint32_t token); void loadRequest(const TokenRequest &req); - bool activeRequestExist(const uint32_t& userType) const; - void activeRequestTokens(const uint32_t& userType, std::list& tokens) const; + bool activeRequestExist(const uint32_t& userType) const; + void activeRequestTokens(const uint32_t& userType, std::list& tokens) const; + void cancelActiveRequestTokens(const uint32_t& userType); protected: void doPoll(float dt);