diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2020-12-14 03:05:16 -0500 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2020-12-14 03:05:16 -0500 |
commit | 22578921b9e577c669cd57385df48cfc08fa90eb (patch) | |
tree | c4a70fa7eb2682e5380e0411df857dd854993fec /discord/objects.cpp | |
parent | 33ed25b2f66e727911182f1552aa8abfd558c69e (diff) | |
download | abaddon-portaudio-22578921b9e577c669cd57385df48cfc08fa90eb.tar.gz abaddon-portaudio-22578921b9e577c669cd57385df48cfc08fa90eb.zip |
pretend to be a real client a little better
Diffstat (limited to 'discord/objects.cpp')
-rw-r--r-- | discord/objects.cpp | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/discord/objects.cpp b/discord/objects.cpp index ac1dc02..5fad61e 100644 --- a/discord/objects.cpp +++ b/discord/objects.cpp @@ -94,29 +94,51 @@ void to_json(nlohmann::json &j, const UpdateStatusMessage &m) { void from_json(const nlohmann::json &j, ReadyEventData &m) { JS_D("v", m.GatewayVersion); - JS_D("user", m.User); + JS_D("user", m.SelfUser); JS_D("guilds", m.Guilds); JS_D("session_id", m.SessionID); - JS_D("analytics_token", m.AnalyticsToken); - JS_D("friend_suggestion_count", m.FriendSuggestionCount); + JS_O("analytics_token", m.AnalyticsToken); + JS_O("friend_suggestion_count", m.FriendSuggestionCount); JS_D("user_settings", m.UserSettings); JS_D("private_channels", m.PrivateChannels); + JS_O("users", m.Users); } void to_json(nlohmann::json &j, const IdentifyProperties &m) { - j["$os"] = m.OS; - j["$browser"] = m.Browser; - j["$device"] = m.Device; + j["os"] = m.OS; + j["browser"] = m.Browser; + j["device"] = m.Device; + j["browser_user_agent"] = m.BrowserUserAgent; + j["browser_version"] = m.BrowserVersion; + j["os_version"] = m.OSVersion; + j["referrer"] = m.Referrer; + j["referring_domain"] = m.ReferringDomain; + j["referrer_current"] = m.ReferrerCurrent; + j["referring_domain_current"] = m.ReferringDomainCurrent; + j["release_channel"] = m.ReleaseChannel; + j["client_build_number"] = m.ClientBuildNumber; + if (m.ClientEventSource == "") + j["client_event_source"] = nullptr; + else + j["client_event_source"] = m.ClientEventSource; +} + +void to_json(nlohmann::json &j, const ClientStateProperties &m) { + j["guild_hashes"] = m.GuildHashes; + j["highest_last_message_id"] = m.HighestLastMessageID; + j["read_state_version"] = m.ReadStateVersion; + j["user_guild_settings_version"] = m.UserGuildSettingsVersion; } void to_json(nlohmann::json &j, const IdentifyMessage &m) { j["op"] = GatewayOp::Identify; j["d"] = nlohmann::json::object(); j["d"]["token"] = m.Token; + j["d"]["capabilities"] = m.Capabilities; j["d"]["properties"] = m.Properties; - - if (m.LargeThreshold) - j["d"]["large_threshold"] = m.LargeThreshold; + j["d"]["presence"] = m.Presence; + j["d"]["compress"] = m.DoesSupportCompression; + j["d"]["client_state"] = m.ClientState; } void to_json(nlohmann::json &j, const HeartbeatMessage &m) { |