From dabfefafd9c681231f990eccddc771ccf5c2c2e2 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Tue, 26 Jan 2021 02:40:50 -0500 Subject: show status indicators in member list, change some other shit with presences --- discord/activity.hpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'discord/activity.hpp') diff --git a/discord/activity.hpp b/discord/activity.hpp index 1e323e3..2cbd5ce 100644 --- a/discord/activity.hpp +++ b/discord/activity.hpp @@ -5,6 +5,13 @@ #include "json.hpp" #include "snowflake.hpp" +enum class PresenceStatus : uint8_t { + Online, + Offline, + Idle, + DND, +}; + enum class ActivityType : int { Game = 0, Streaming = 1, @@ -28,8 +35,8 @@ struct Bitwise { }; struct ActivityTimestamps { - std::optional Start; // opt - std::optional End; // opt + std::optional Start; + std::optional End; friend void from_json(const nlohmann::json &j, ActivityTimestamps &m); friend void to_json(nlohmann::json &j, const ActivityTimestamps &m); @@ -94,8 +101,9 @@ struct ActivityData { struct PresenceData { std::vector Activities; // null (but never sent as such) std::string Status; - bool IsAFK; - int Since = 0; + std::optional IsAFK; + std::optional Since; + friend void from_json(const nlohmann::json &j, PresenceData &m); friend void to_json(nlohmann::json &j, const PresenceData &m); }; -- cgit v1.2.3