summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-05-03 20:25:34 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-05-03 20:25:34 +0300
commitd61fb51575143353832cf3e4092be0e74d2d307a (patch)
tree0f53380150d28e2f25e38530aeef8f92fc4329ae /protocols
parentfc06fc0a10dba14724cd278f8356520e4e71080e (diff)
Discord: no need to add #0 to my own nick in group chats
Diffstat (limited to 'protocols')
-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 42fd0bd4d9..f35c81cfaa 100644
--- a/protocols/Discord/src/utils.cpp
+++ b/protocols/Discord/src/utils.cpp
@@ -224,8 +224,12 @@ void CDiscordProto::PreparePrivateChannel(const JSONNode &root)
Chat_Event(&gce);
}
- CMStringW wszId(FORMAT, L"%lld", getId(DB_KEY_ID));
- CMStringW wszNick(FORMAT, L"%s#%d", getMStringW(DB_KEY_NICK).c_str(), getDword(DB_KEY_DISCR));
+ CMStringW wszId(FORMAT, L"%lld", getId(DB_KEY_ID)), wszNick;
+ if (auto iDiscr = getDword(DB_KEY_DISCR))
+ wszNick.Format(L"%s#%d", getMStringW(DB_KEY_NICK).c_str(), iDiscr);
+ else
+ wszNick = getMStringW(DB_KEY_NICK);
+
gce.bIsMe = true;
gce.pszUID.w = wszId;
gce.pszNick.w = wszNick;