summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-11-19 19:45:04 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-11-19 19:45:04 +0300
commit11a28a886672e2e96dcddefd9fae2622ab5b965c (patch)
tree0f7c1f3af3dbc7501e838e6bac33c76651a4c765
parenteaf991b1de462b6c3dd61fcef75231e0579f5cef (diff)
Discord: we don't use discriminators in groupchat nicks
-rw-r--r--protocols/Discord/src/dispatch.cpp3
-rw-r--r--protocols/Discord/src/guilds.cpp4
2 files changed, 4 insertions, 3 deletions
diff --git a/protocols/Discord/src/dispatch.cpp b/protocols/Discord/src/dispatch.cpp
index 6cdef5e4de..fee35b6c06 100644
--- a/protocols/Discord/src/dispatch.cpp
+++ b/protocols/Discord/src/dispatch.cpp
@@ -277,9 +277,10 @@ void CDiscordProto::OnCommandGuildMemberUpdated(const JSONNode &pRoot)
if (gm == nullptr)
return;
+ gm->wszDiscordId = pRoot["user"]["username"].as_mstring() + L"#" + pRoot["user"]["discriminator"].as_mstring();
gm->wszNick = pRoot["nick"].as_mstring();
if (gm->wszNick.IsEmpty())
- gm->wszNick = pRoot["user"]["username"].as_mstring() + L"#" + pRoot["user"]["discriminator"].as_mstring();
+ gm->wszNick = pRoot["user"]["username"].as_mstring();
for (auto &it : arUsers) {
if (it->pGuild != pGuild)
diff --git a/protocols/Discord/src/guilds.cpp b/protocols/Discord/src/guilds.cpp
index 3bed5cee8f..9b11342881 100644
--- a/protocols/Discord/src/guilds.cpp
+++ b/protocols/Discord/src/guilds.cpp
@@ -295,7 +295,7 @@ CDiscordGuildMember* CDiscordProto::ProcessGuildUser(CDiscordGuild *pGuild, cons
pm->wszDiscordId = pUser["username"].as_mstring() + L"#" + pUser["discriminator"].as_mstring();
pm->wszNick = pRoot["nick"].as_mstring();
if (pm->wszNick.IsEmpty())
- pm->wszNick = pm->wszDiscordId;
+ pm->wszNick = pUser["username"].as_mstring();
else
bNew = true;
@@ -336,7 +336,7 @@ void CDiscordProto::ProcessChatUser(CDiscordUser *pChat, const CMStringW &wszUse
pm->wszDiscordId = pRoot["author"]["username"].as_mstring() + L"#" + pRoot["author"]["discriminator"].as_mstring();
pm->wszNick = pRoot["nick"].as_mstring();
if (pm->wszNick.IsEmpty())
- pm->wszNick = pm->wszDiscordId;
+ pm->wszNick = pRoot["author"]["username"].as_mstring();
pGuild->arChatUsers.insert(pm);
debugLogA("add missing user to chat: id=%lld, nick=%S", userId, pm->wszNick.c_str());