From a3c95404f5e1dff8c0ba4634f86522ee4c6ad2cc Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 15 Feb 2017 16:40:02 +0300 Subject: fix for highlighting non-mentioned contacts in groupchat --- protocols/Discord/src/utils.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'protocols/Discord/src') diff --git a/protocols/Discord/src/utils.cpp b/protocols/Discord/src/utils.cpp index b1390a9ec0..4666ab188f 100644 --- a/protocols/Discord/src/utils.cpp +++ b/protocols/Discord/src/utils.cpp @@ -279,8 +279,12 @@ void CDiscordProto::ParseSpecialChars(SESSION_INFO *si, CMStringW &str) return; CMStringW wszWord = str.Mid(i + 1, iEnd - i - 1); - if (wszWord[0] == '@' && wszWord[1] == '!') { // member highlight - USERINFO *ui = pci->UM_FindUser(si->pUsers, wszWord.c_str()+2); + if (wszWord[0] == '@') { // member highlight + int iStart = 1; + if (wszWord[1] == '!') + iStart++; + + USERINFO *ui = pci->UM_FindUser(si->pUsers, wszWord.c_str() + iStart); if (ui != nullptr) str.Replace(L"<" + wszWord + L">", CMStringW('@') + ui->pszNick); } -- cgit v1.2.3