diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-01-26 02:40:50 -0500 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-01-26 02:40:50 -0500 |
commit | dabfefafd9c681231f990eccddc771ccf5c2c2e2 (patch) | |
tree | 35fc440dbacf8367fa650dde89217b23cf08bf33 /discord/activity.cpp | |
parent | e6c159659d30ca3cc955b9a7f7969f51d87a0bf9 (diff) | |
download | abaddon-portaudio-dabfefafd9c681231f990eccddc771ccf5c2c2e2.tar.gz abaddon-portaudio-dabfefafd9c681231f990eccddc771ccf5c2c2e2.zip |
show status indicators in member list, change some other shit with presences
Diffstat (limited to 'discord/activity.cpp')
-rw-r--r-- | discord/activity.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/discord/activity.cpp b/discord/activity.cpp index ff02758..95dda5d 100644 --- a/discord/activity.cpp +++ b/discord/activity.cpp @@ -100,9 +100,17 @@ void to_json(nlohmann::json &j, const ActivityData &m) { JS_IF("flags", m.Flags); } +void from_json(const nlohmann::json &j, PresenceData &m) { + JS_N("activities", m.Activities); + JS_D("status", m.Status); +} + void to_json(nlohmann::json &j, const PresenceData &m) { j["activities"] = m.Activities; j["status"] = m.Status; - j["afk"] = m.IsAFK; - j["since"] = m.Since; + JS_IF("afk", m.IsAFK); + if (m.Since.has_value()) + j["since"] = *m.Since; + else + j["since"] = 0; } |