mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
ignore undesirable users' messages
This commit is contained in:
parent
5c7af334ca
commit
f17c2b98ca
3 changed files with 7 additions and 3 deletions
|
@ -11,6 +11,7 @@
|
||||||
#include "singletons/windowmanager.hpp"
|
#include "singletons/windowmanager.hpp"
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
using namespace chatterino::singletons;
|
using namespace chatterino::singletons;
|
||||||
using namespace chatterino::messages;
|
using namespace chatterino::messages;
|
||||||
|
@ -159,7 +160,8 @@ void IrcMessageHandler::handleWhisperMessage(Communi::IrcMessage *message)
|
||||||
|
|
||||||
twitch::TwitchMessageBuilder builder(c, message, message->parameter(1), args);
|
twitch::TwitchMessageBuilder builder(c, message, message->parameter(1), args);
|
||||||
|
|
||||||
if (!builder.isIgnored()) {
|
const static std::vector<QString> vec{"airbrushgrenade", "scizth0"};
|
||||||
|
if (!builder.isIgnored() && std::find(vec.begin(), vec.end(), message->nick()) == vec.end()) {
|
||||||
messages::MessagePtr _message = builder.build();
|
messages::MessagePtr _message = builder.build();
|
||||||
if (_message->flags & messages::Message::Highlighted) {
|
if (_message->flags & messages::Message::Highlighted) {
|
||||||
TwitchServer::getInstance().mentionsChannel->addMessage(_message);
|
TwitchServer::getInstance().mentionsChannel->addMessage(_message);
|
||||||
|
|
|
@ -310,7 +310,8 @@ void TwitchChannel::fetchRecentMessages()
|
||||||
|
|
||||||
messages::MessageParseArgs args;
|
messages::MessageParseArgs args;
|
||||||
twitch::TwitchMessageBuilder builder(channel, privMsg, args);
|
twitch::TwitchMessageBuilder builder(channel, privMsg, args);
|
||||||
if (!builder.isIgnored()) {
|
const static std::vector<QString> vec{"airbrushgrenade", "scizth0"};
|
||||||
|
if (!builder.isIgnored() && std::find(vec.begin(), vec.end(), privMsg->nick()) == vec.end()) {
|
||||||
messages.push_back(builder.build());
|
messages.push_back(builder.build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,7 +90,8 @@ void TwitchServer::privateMessageReceived(IrcPrivateMessage *message)
|
||||||
|
|
||||||
TwitchMessageBuilder builder(chan.get(), message, args);
|
TwitchMessageBuilder builder(chan.get(), message, args);
|
||||||
|
|
||||||
if (!builder.isIgnored()) {
|
const static std::vector<QString> vec{"airbrushgrenade", "scizth0"};
|
||||||
|
if (!builder.isIgnored() && std::find(vec.begin(), vec.end(), message->nick()) == vec.end()) {
|
||||||
messages::MessagePtr _message = builder.build();
|
messages::MessagePtr _message = builder.build();
|
||||||
if (_message->flags & messages::Message::Highlighted) {
|
if (_message->flags & messages::Message::Highlighted) {
|
||||||
TwitchServer::getInstance().mentionsChannel->addMessage(_message);
|
TwitchServer::getInstance().mentionsChannel->addMessage(_message);
|
||||||
|
|
Loading…
Reference in a new issue