Ignore chat messages from ignore list nicks in game too
authorS-D-
Thu, 19 Sep 2019 23:39:40 +0300
changeset 15438 5fcdc072d706
parent 15437 f1e0e92ab7f3
child 15439 36c263a6141d
Ignore chat messages from ignore list nicks in game too
QTfrontend/net/newnetclient.cpp
QTfrontend/ui/widget/chatwidget.cpp
--- a/QTfrontend/net/newnetclient.cpp	Thu Sep 19 17:06:47 2019 +0200
+++ b/QTfrontend/net/newnetclient.cpp	Thu Sep 19 23:39:40 2019 +0300
@@ -438,6 +438,10 @@
             // Another kind of fake nick. '(' nicks are server messages, but they must not be translated
             if(!sender.startsWith('('))
             {
+                // don't handle chat messages that are from ignored nicks
+                if (m_playersModel->isFlagSet(sender, PlayersListModel::Ignore))
+                    return;
+
                 // Check for action (/me command)
                 action = HWProto::chatStringToAction(message);
             }
--- a/QTfrontend/ui/widget/chatwidget.cpp	Thu Sep 19 17:06:47 2019 +0200
+++ b/QTfrontend/ui/widget/chatwidget.cpp	Thu Sep 19 23:39:40 2019 +0300
@@ -426,10 +426,6 @@
     if(!m_usersModel)
         return;
 
-    // don't show chat lines that are from ignored nicks
-    if (m_usersModel->isFlagSet(nick, PlayersListModel::Ignore))
-        return;
-
     bool isFriend = (!nick.isEmpty()) && m_usersModel->isFlagSet(nick, PlayersListModel::Friend);
 
     QString cssClass = (isFriend ? "msg_Friend" : "msg_User") + cssClassPart;