fix: don't include blocked users in join/part messages (#6181)
This commit is contained in:
@@ -53,7 +53,7 @@ QString blockUser(const CommandContext &ctx)
|
||||
[currentUser, channel{ctx.channel},
|
||||
target](const HelixUser &targetUser) {
|
||||
getApp()->getAccounts()->twitch.getCurrent()->blockUser(
|
||||
targetUser.id, nullptr,
|
||||
targetUser.id, targetUser.login, nullptr,
|
||||
[channel, target, targetUser] {
|
||||
channel->addSystemMessage(
|
||||
QString("You successfully blocked user %1")
|
||||
@@ -125,7 +125,7 @@ QString unblockUser(const CommandContext &ctx)
|
||||
target,
|
||||
[currentUser, channel{ctx.channel}, target](const auto &targetUser) {
|
||||
getApp()->getAccounts()->twitch.getCurrent()->unblockUser(
|
||||
targetUser.id, nullptr,
|
||||
targetUser.id, targetUser.login, nullptr,
|
||||
[channel, target, targetUser] {
|
||||
channel->addSystemMessage(
|
||||
QString("You successfully unblocked user %1")
|
||||
|
||||
@@ -149,16 +149,27 @@ bool isIgnoredMessage(IgnoredMessageParameters &¶ms)
|
||||
}
|
||||
}
|
||||
|
||||
if (!params.twitchUserID.isEmpty() &&
|
||||
getSettings()->enableTwitchBlockedUsers)
|
||||
if (getSettings()->enableTwitchBlockedUsers)
|
||||
{
|
||||
auto sourceUserID = params.twitchUserID;
|
||||
bool isBlocked = false;
|
||||
|
||||
if (!params.twitchUserID.isEmpty())
|
||||
{
|
||||
isBlocked = getApp()
|
||||
->getAccounts()
|
||||
->twitch.getCurrent()
|
||||
->blockedUserIds()
|
||||
.contains(params.twitchUserID);
|
||||
}
|
||||
else if (!params.twitchUserLogin.isEmpty())
|
||||
{
|
||||
isBlocked = getApp()
|
||||
->getAccounts()
|
||||
->twitch.getCurrent()
|
||||
->blockedUserLogins()
|
||||
.contains(params.twitchUserLogin);
|
||||
}
|
||||
|
||||
bool isBlocked = getApp()
|
||||
->getAccounts()
|
||||
->twitch.getCurrent()
|
||||
->blockedUserIds()
|
||||
.contains(sourceUserID);
|
||||
if (isBlocked)
|
||||
{
|
||||
switch (static_cast<ShowIgnoredUsersMessages>(
|
||||
|
||||
@@ -15,6 +15,7 @@ struct IgnoredMessageParameters {
|
||||
QString message;
|
||||
|
||||
QString twitchUserID;
|
||||
QString twitchUserLogin;
|
||||
bool isMod;
|
||||
bool isBroadcaster;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user