summaryrefslogtreecommitdiff
path: root/protocols/Discord/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-02-15 16:40:02 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-02-15 16:40:02 +0300
commita3c95404f5e1dff8c0ba4634f86522ee4c6ad2cc (patch)
tree59fe0c2f60754b45384d5fe67e1f03e86c22ae48 /protocols/Discord/src
parentabe6893ccd9bb88abf7541b46c9a430f4e058317 (diff)
fix for highlighting non-mentioned contacts in groupchat
Diffstat (limited to 'protocols/Discord/src')
-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);
}