summaryrefslogtreecommitdiff
path: root/discord/message.cpp
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2020-09-20 01:12:54 -0400
committerouwou <26526779+ouwou@users.noreply.github.com>2020-09-20 01:12:54 -0400
commit4b7cdbd129cedd4029c2b99c85146ad5e07e9732 (patch)
tree955341fa06c7d54b1449a491c5291ddd3e9830c2 /discord/message.cpp
parent83b480742b46f120b73042791e2f91c70ce3fe84 (diff)
downloadabaddon-portaudio-4b7cdbd129cedd4029c2b99c85146ad5e07e9732.tar.gz
abaddon-portaudio-4b7cdbd129cedd4029c2b99c85146ad5e07e9732.zip
improve MESSAGE_UPDATE handling (hopefully)
Diffstat (limited to 'discord/message.cpp')
-rw-r--r--discord/message.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/discord/message.cpp b/discord/message.cpp
index 044c2e5..4134435 100644
--- a/discord/message.cpp
+++ b/discord/message.cpp
@@ -79,6 +79,8 @@ void from_json(const nlohmann::json &j, Message &m) {
JS_D("content", m.Content);
JS_D("timestamp", m.Timestamp);
JS_N("edited_timestamp", m.EditedTimestamp);
+ if (!j.at("edited_timestamp").is_null())
+ m.SetEdited();
JS_D("tts", m.IsTTS);
JS_D("mention_everyone", m.DoesMentionEveryone);
JS_D("mentions", m.Mentions);
@@ -97,7 +99,6 @@ void from_json(const nlohmann::json &j, Message &m) {
JS_O("flags", m.Flags);
}
-// probably gonna need to return present keys
void Message::from_json_edited(const nlohmann::json &j) {
JS_D("id", ID);
JS_D("channel_id", ChannelID);
@@ -109,6 +110,7 @@ void Message::from_json_edited(const nlohmann::json &j) {
JS_O("tts", IsTTS);
JS_O("mention_everyone", DoesMentionEveryone);
JS_O("mentions", Mentions);
+ JS_O("embeds", Embeds);
JS_O("nonce", Nonce);
JS_O("pinned", IsPinned);
JS_O("webhook_id", WebhookID);
@@ -120,9 +122,8 @@ void Message::SetDeleted() {
m_deleted = true;
}
-void Message::SetEdited(std::string new_content) {
+void Message::SetEdited() {
m_edited = true;
- Content = new_content;
}
bool Message::IsDeleted() const {