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
4 changed files with 22 additions and 0 deletions
+19
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()
{
for (const auto &p : this->clients)