From 61dac49f6d67c684d8bdadaf9bfed8a7b71b0a3b Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Sat, 12 May 2018 23:27:34 +0200 Subject: [PATCH] Implement basic and stupid ignore functionality We currently do not respect mod status --- src/providers/twitch/twitchmessagebuilder.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/providers/twitch/twitchmessagebuilder.cpp b/src/providers/twitch/twitchmessagebuilder.cpp index 172cc3256..4ec686b1e 100644 --- a/src/providers/twitch/twitchmessagebuilder.cpp +++ b/src/providers/twitch/twitchmessagebuilder.cpp @@ -76,6 +76,17 @@ bool TwitchMessageBuilder::isIgnored() const } } + if (this->tags.contains("user-id")) { + auto sourceUserID = this->tags.value("user-id").toString(); + + for (const auto &user : app->accounts->Twitch.getCurrent()->getIgnores()) { + if (sourceUserID == user.id) { + debug::Log("Blocking message because it's from blocked user {}", user.name); + return true; + } + } + } + return false; }