fix: unlisten to automod on user change (#3718)

Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
Sidd 2022-05-08 03:56:40 -07:00 committed by GitHub
parent 07dd8c560b
commit 94f067ce62
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 0 deletions

View file

@ -20,6 +20,7 @@
- Bugfix: Fixed an issue in the emote picker where an emotes tooltip would not properly disappear. (#3686) - 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 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 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) - Dev: Use Game Name returned by Get Streams instead of querying it from the Get Games API. (#3662)
## 2.3.5 ## 2.3.5

View file

@ -507,6 +507,7 @@ void Application::initPubSub()
this->accounts->twitch.currentUserChanged.connect( this->accounts->twitch.currentUserChanged.connect(
[=] { [=] {
this->twitch->pubsub->unlistenAllModerationActions(); this->twitch->pubsub->unlistenAllModerationActions();
this->twitch->pubsub->unlistenAutomod();
this->twitch->pubsub->unlistenWhispers(); this->twitch->pubsub->unlistenWhispers();
}, },
boost::signals2::at_front); boost::signals2::at_front);

View file

@ -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() void PubSub::unlistenWhispers()
{ {
for (const auto &p : this->clients) for (const auto &p : this->clients)

View file

@ -119,6 +119,7 @@ public:
} signals_; } signals_;
void unlistenAllModerationActions(); void unlistenAllModerationActions();
void unlistenAutomod();
void unlistenWhispers(); void unlistenWhispers();
bool listenToWhispers(); bool listenToWhispers();