diff --git a/CHANGELOG.md b/CHANGELOG.md index d93796ec..6789f29e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ - Bugfix: Fixed an issue in the emote picker where an emotes tooltip would not properly disappear. (#3686) - Bugfix: Fixed incorrect spacing of settings icons at high DPI. (#3698) - Bugfix: Fixed existing emote popups not being raised from behind other windows when refocusing them on macOS (#3713) +- Bugfix: Fixed automod queue pubsub topic persisting after user change. (#3718) - Dev: Use Game Name returned by Get Streams instead of querying it from the Get Games API. (#3662) ## 2.3.5 diff --git a/src/Application.cpp b/src/Application.cpp index 67c70e9e..083514ef 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -507,6 +507,7 @@ void Application::initPubSub() this->accounts->twitch.currentUserChanged.connect( [=] { this->twitch->pubsub->unlistenAllModerationActions(); + this->twitch->pubsub->unlistenAutomod(); this->twitch->pubsub->unlistenWhispers(); }, boost::signals2::at_front); diff --git a/src/providers/twitch/PubSubManager.cpp b/src/providers/twitch/PubSubManager.cpp index 8c6003cc..cce10786 100644 --- a/src/providers/twitch/PubSubManager.cpp +++ b/src/providers/twitch/PubSubManager.cpp @@ -547,6 +547,25 @@ void PubSub::unlistenAllModerationActions() } } +void PubSub::unlistenAutomod() +{ + for (const auto &p : this->clients) + { + const auto &client = p.second; + if (const auto &[topics, nonce] = + client->unlistenPrefix("automod-queue."); + !topics.empty()) + { + this->registerNonce(nonce, { + client, + "UNLISTEN", + topics, + topics.size(), + }); + } + } +} + void PubSub::unlistenWhispers() { for (const auto &p : this->clients) diff --git a/src/providers/twitch/PubSubManager.hpp b/src/providers/twitch/PubSubManager.hpp index d078e519..f1cecd44 100644 --- a/src/providers/twitch/PubSubManager.hpp +++ b/src/providers/twitch/PubSubManager.hpp @@ -119,6 +119,7 @@ public: } signals_; void unlistenAllModerationActions(); + void unlistenAutomod(); void unlistenWhispers(); bool listenToWhispers();