mirror of
https://github.com/uowuo/abaddon.git
synced 2024-11-10 14:10:10 +00:00
fix some PRESENCE_UPDATE bugs
This commit is contained in:
parent
99597a80d2
commit
00770e4bcb
@ -606,6 +606,7 @@ void DiscordClient::HandleGatewayGuildMemberUpdate(const GatewayMessage &msg) {
|
||||
void DiscordClient::HandleGatewayPresenceUpdate(const GatewayMessage &msg) {
|
||||
PresenceUpdateMessage data = msg.Data;
|
||||
auto cur = m_store.GetUser(data.User.at("id").get<Snowflake>());
|
||||
if (cur != nullptr)
|
||||
User::update_from_json(data.User, *cur);
|
||||
}
|
||||
|
||||
|
@ -150,7 +150,7 @@ void from_json(const nlohmann::json &j, ClientStatus &m) {
|
||||
|
||||
void from_json(const nlohmann::json &j, PresenceUpdateMessage &m) {
|
||||
m.User = j.at("user");
|
||||
JS_D("guild_id", m.GuildID);
|
||||
JS_O("guild_id", m.GuildID);
|
||||
JS_D("status", m.Status);
|
||||
// JS_D("activities", m.Activities);
|
||||
JS_D("client_status", m.ClientStatus);
|
||||
|
@ -213,7 +213,7 @@ struct ClientStatus {
|
||||
|
||||
struct PresenceUpdateMessage {
|
||||
nlohmann::json User; // the client updates an existing object from this data
|
||||
Snowflake GuildID;
|
||||
Snowflake GuildID; // opt
|
||||
std::string Status;
|
||||
// std::vector<Activity> Activities;
|
||||
ClientStatus ClientStatus;
|
||||
|
Loading…
Reference in New Issue
Block a user