summaryrefslogtreecommitdiff
path: root/protocols/Discord/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-12-10 15:51:48 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-12-10 15:51:52 +0300
commit2e44a9394e3c0ece41c765bec5b00339f36f8484 (patch)
treec324244bf50f4010454c9a5b026f5e48654802ba /protocols/Discord/src
parenta9d056e7414d0c9cedae76e3313b27fb5b429280 (diff)
fixes #4799 ([Discord] Most messages (even older ones before the bug?) seem to be marked with non-existant reply ID, causing all messages to look like replies)
Diffstat (limited to 'protocols/Discord/src')
-rw-r--r--protocols/Discord/src/dispatch.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/protocols/Discord/src/dispatch.cpp b/protocols/Discord/src/dispatch.cpp
index abcae9afb8..1d4209715f 100644
--- a/protocols/Discord/src/dispatch.cpp
+++ b/protocols/Discord/src/dispatch.cpp
@@ -521,10 +521,11 @@ void CDiscordProto::OnCommandMessage(const JSONNode &pRoot, bool bIsNew)
if (userId == m_ownId)
dbei.flags |= DBEF_READ | DBEF_SENT;
- if (auto &nReply = pRoot["message_reference"]) {
- _i64toa(::getId(nReply["message_id"]), szReplyId, 10);
- dbei.szReplyId = szReplyId;
- }
+ if (auto &nReply = pRoot["message_reference"])
+ if (auto replyId = ::getId(nReply["message_id"])) {
+ _i64toa(replyId, szReplyId, 10);
+ dbei.szReplyId = szReplyId;
+ }
debugLogA("store a message from private user %lld, channel id %lld", pUser->id, pUser->channelId);