From 042f2bb56726e7607c6d1fc2d777ebcf8c6d4aea Mon Sep 17 00:00:00 2001 From: nheir Date: Sun, 27 Jan 2019 22:20:45 +0100 Subject: [PATCH] filter whisper target id like other chat messages --- src/game/client/components/chat.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/game/client/components/chat.cpp b/src/game/client/components/chat.cpp index 63f1f3896..05d31b757 100644 --- a/src/game/client/components/chat.cpp +++ b/src/game/client/components/chat.cpp @@ -380,8 +380,11 @@ void CChat::AddLine(int ClientID, int Mode, const char *pLine, int TargetID) if(*pLine == 0 || (ClientID != -1 && (!g_Config.m_ClShowsocial || !m_pClient->m_aClients[ClientID].m_Active || // unknown client m_pClient->m_aClients[ClientID].m_ChatIgnore || g_Config.m_ClFilterchat == 2 || - (m_pClient->m_LocalClientID != ClientID && g_Config.m_ClFilterchat == 1 && !m_pClient->m_aClients[ClientID].m_Friend))) - || (TargetID == -1 && Mode == CHAT_WHISPER)) + (m_pClient->m_LocalClientID != ClientID && g_Config.m_ClFilterchat == 1 && !m_pClient->m_aClients[ClientID].m_Friend)))) + return; + if(Mode == CHAT_WHISPER && (TargetID == -1 || !m_pClient->m_aClients[TargetID].m_Active || // unknown client + m_pClient->m_aClients[TargetID].m_ChatIgnore || g_Config.m_ClFilterchat == 2 || + (m_pClient->m_LocalClientID != TargetID && g_Config.m_ClFilterchat == 1 && !m_pClient->m_aClients[TargetID].m_Friend))) return; // trim right and set maximum length to 128 utf8-characters