summaryrefslogtreecommitdiff
path: root/discord/channel.cpp
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2021-07-28 03:34:36 -0400
committerouwou <26526779+ouwou@users.noreply.github.com>2021-07-28 03:34:36 -0400
commit014e176e0a7cf457a03278dbdf8495400981b8b2 (patch)
treeaf04057a3ed6ca7da1f646a8b7a6440425ec5d94 /discord/channel.cpp
parent9d2d13a3898f05f9e8189f99087198726d476e1b (diff)
downloadabaddon-portaudio-014e176e0a7cf457a03278dbdf8495400981b8b2.tar.gz
abaddon-portaudio-014e176e0a7cf457a03278dbdf8495400981b8b2.zip
handle THREAD_CREATE
also fix compilation also change channel_create signal to emit ChannelData
Diffstat (limited to 'discord/channel.cpp')
-rw-r--r--discord/channel.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/discord/channel.cpp b/discord/channel.cpp
index e5dfb06..685cc72 100644
--- a/discord/channel.cpp
+++ b/discord/channel.cpp
@@ -1,13 +1,20 @@
#include "../abaddon.hpp"
#include "channel.hpp"
-void from_json(const nlohmann::json &j, ThreadMetadata &m) {
+void from_json(const nlohmann::json &j, ThreadMetadataData &m) {
JS_D("archived", m.IsArchived);
JS_D("auto_archive_duration", m.AutoArchiveDuration);
JS_D("archive_timestamp", m.ArchiveTimestamp);
JS_O("locked", m.IsLocked);
}
+void from_json(const nlohmann::json &j, ThreadMemberObject &m) {
+ JS_O("id", m.ThreadID);
+ JS_O("user_id", m.ThreadID);
+ JS_D("join_timestamp", m.JoinTimestamp);
+ JS_D("flags", m.Flags);
+}
+
void from_json(const nlohmann::json &j, ChannelData &m) {
JS_D("id", m.ID);
JS_D("type", m.Type);
@@ -29,6 +36,7 @@ void from_json(const nlohmann::json &j, ChannelData &m) {
JS_ON("parent_id", m.ParentID);
JS_ON("last_pin_timestamp", m.LastPinTimestamp);
JS_O("thread_metadata", m.ThreadMetadata);
+ JS_O("member", m.ThreadMember);
}
void ChannelData::update_from_json(const nlohmann::json &j) {