--- a/QTfrontend/net/newnetclient.cpp Sun Oct 30 18:29:29 2022 +0200
+++ b/QTfrontend/net/newnetclient.cpp Mon Oct 31 02:11:37 2022 +0200
@@ -426,6 +426,7 @@
return;
}
+ bool isIgnored = false;
QString action;
QString message;
QString sender = lst[1];
@@ -438,6 +439,7 @@
// Another kind of fake nick. '(' nicks are server messages, but they must not be translated
if(!sender.startsWith('('))
{
+ isIgnored = m_playersModel->isFlagSet(sender, PlayersListModel::Ignore);
// Check for action (/me command)
action = HWProto::chatStringToAction(message);
}
@@ -465,7 +467,10 @@
}
else
{
- emit chatStringFromNet(HWProto::formatChatMsg(sender, message));
+ if (isIgnored)
+ emit chatStringFromNetIgnored(HWProto::formatChatMsg(sender, message));
+ else
+ emit chatStringFromNet(HWProto::formatChatMsg(sender, message));
if (!action.isNull())
emit roomChatAction(sender, action);
else
@@ -492,7 +497,12 @@
}
else
{
- emit chatStringFromNet(HWProto::formatDirectMsg(mynick, nick, message, isEcho));
+ bool isIgnored = m_playersModel->isFlagSet(nick, PlayersListModel::Ignore) && !isEcho;
+ QString formattedMsg = HWProto::formatDirectMsg(mynick, nick, message, isEcho);
+ if (isIgnored)
+ emit chatStringFromNetIgnored(formattedMsg);
+ else
+ emit chatStringFromNet(formattedMsg);
emit roomDirectMessage(nick, message, isEcho);
}
return;