From 22578921b9e577c669cd57385df48cfc08fa90eb Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Mon, 14 Dec 2020 03:05:16 -0500 Subject: pretend to be a real client a little better --- discord/objects.hpp | 41 ++++++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 9 deletions(-) (limited to 'discord/objects.hpp') diff --git a/discord/objects.hpp b/discord/objects.hpp index 8651068..2213ba5 100644 --- a/discord/objects.hpp +++ b/discord/objects.hpp @@ -146,21 +146,23 @@ struct UpdateStatusMessage { std::vector Activities; // null (but never sent as such) std::string Status; bool IsAFK; + int Since = 0; friend void to_json(nlohmann::json &j, const UpdateStatusMessage &m); }; struct ReadyEventData { - int GatewayVersion; // - User User; // - std::vector Guilds; // - std::string SessionID; // - std::vector PrivateChannels; // + int GatewayVersion; + User SelfUser; + std::vector Guilds; + std::string SessionID; + std::vector PrivateChannels; // undocumented - std::string AnalyticsToken; // opt - int FriendSuggestionCount; // opt - UserSettings UserSettings; // opt + std::optional> Users; + std::optional AnalyticsToken; + std::optional FriendSuggestionCount; + UserSettings UserSettings; // std::vector ConnectedAccounts; // opt // std::map Consents; // opt // std::vector Experiments; // opt @@ -179,15 +181,36 @@ struct IdentifyProperties { std::string OS; std::string Browser; std::string Device; + std::string BrowserUserAgent; + std::string BrowserVersion; + std::string OSVersion; + std::string Referrer; + std::string ReferringDomain; + std::string ReferrerCurrent; + std::string ReferringDomainCurrent; + std::string ReleaseChannel; + int ClientBuildNumber; + std::string ClientEventSource; // empty -> null friend void to_json(nlohmann::json &j, const IdentifyProperties &m); }; +struct ClientStateProperties { + std::map GuildHashes; + std::string HighestLastMessageID = "0"; + int ReadStateVersion = 0; + int UserGuildSettingsVersion = -1; + + friend void to_json(nlohmann::json &j, const ClientStateProperties &m); +}; + struct IdentifyMessage : GatewayMessage { std::string Token; IdentifyProperties Properties; + UpdateStatusMessage Presence; + ClientStateProperties ClientState; bool DoesSupportCompression = false; - int LargeThreshold = 0; + int Capabilities; friend void to_json(nlohmann::json &j, const IdentifyMessage &m); }; -- cgit v1.2.3