diff options
author | George Hazan <ghazan@miranda.im> | 2019-11-08 12:31:10 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-11-08 12:31:16 +0300 |
commit | 053eae7ce2b585aebed1edd13ff7a039032da1f0 (patch) | |
tree | 4457df08e5275e50ca89580ddba6d2048aea01b7 /protocols/Discord | |
parent | ff819f9907b8231bea06b1bed659b6669e2ffe72 (diff) |
fixes #2120 ([Discord] If you already have a custom status, setting it again causes a crash)
Diffstat (limited to 'protocols/Discord')
-rw-r--r-- | protocols/Discord/src/proto.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/protocols/Discord/src/proto.cpp b/protocols/Discord/src/proto.cpp index b8948afe17..72dca1ff6a 100644 --- a/protocols/Discord/src/proto.cpp +++ b/protocols/Discord/src/proto.cpp @@ -448,9 +448,9 @@ int CDiscordProto::SetAwayMsg(int iStatus, const wchar_t *msg) if (!mir_wstrcmp(msg, pwszMessage)) return 0; - pwszMessage = mir_wstrdup(msg); + replaceStrW(pwszMessage, msg); - JSONNode status; status.set_name("custom_status"); status << WCHAR_PARAM("text", msg); + JSONNode status; status.set_name("custom_status"); status << WCHAR_PARAM("text", (msg) ? msg : L""); JSONNode root; root << status; Push(new AsyncHttpRequest(this, REQUEST_PATCH, "/users/@me/settings", nullptr, &root)); return 0; |