mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 09:38:19 +00:00
Merge pull request #8963 from ChillerDragon/pr_fix_hilite
Fix name in chat not being highlighted (Closed #2190)
This commit is contained in:
commit
ce245f479a
|
@ -552,14 +552,16 @@ void CChat::OnMessage(int MsgType, void *pRawMsg)
|
|||
|
||||
bool CChat::LineShouldHighlight(const char *pLine, const char *pName)
|
||||
{
|
||||
const char *pHL = str_utf8_find_nocase(pLine, pName);
|
||||
const char *pHit = str_utf8_find_nocase(pLine, pName);
|
||||
|
||||
if(pHL)
|
||||
while(pHit)
|
||||
{
|
||||
int Length = str_length(pName);
|
||||
|
||||
if(Length > 0 && (pLine == pHL || pHL[-1] == ' ') && (pHL[Length] == 0 || pHL[Length] == ' ' || pHL[Length] == '.' || pHL[Length] == '!' || pHL[Length] == ',' || pHL[Length] == '?' || pHL[Length] == ':'))
|
||||
if(Length > 0 && (pLine == pHit || pHit[-1] == ' ') && (pHit[Length] == 0 || pHit[Length] == ' ' || pHit[Length] == '.' || pHit[Length] == '!' || pHit[Length] == ',' || pHit[Length] == '?' || pHit[Length] == ':'))
|
||||
return true;
|
||||
|
||||
pHit = str_utf8_find_nocase(pHit + 1, pName);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue