summaryrefslogtreecommitdiff
path: root/protocols/Discord/src/utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Discord/src/utils.cpp')
-rw-r--r--protocols/Discord/src/utils.cpp8
1 files changed, 6 insertions, 2 deletions
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);
}