diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-05-08 23:35:15 -0400 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-05-08 23:35:15 -0400 |
commit | 469053a14468f08dc694a1ef8d98f0265a72dd07 (patch) | |
tree | 82a221fa2cfd4a38223bc667a88896080b58725f /discord/discord.cpp | |
parent | dd7852014fa1dbb4fd95fcc45dccf9e87b272eb6 (diff) | |
download | abaddon-portaudio-469053a14468f08dc694a1ef8d98f0265a72dd07.tar.gz abaddon-portaudio-469053a14468f08dc694a1ef8d98f0265a72dd07.zip |
handle RELATIONSHIP_REMOVE
Diffstat (limited to 'discord/discord.cpp')
-rw-r--r-- | discord/discord.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/discord/discord.cpp b/discord/discord.cpp index 8bd03bb..1045176 100644 --- a/discord/discord.cpp +++ b/discord/discord.cpp @@ -1035,6 +1035,9 @@ void DiscordClient::HandleGatewayMessage(std::string str) { case GatewayEvent::GUILD_JOIN_REQUEST_DELETE: { HandleGatewayGuildJoinRequestDelete(m); } break; + case GatewayEvent::RELATIONSHIP_REMOVE: { + HandleGatewayRelationshipRemove(m); + } break; } } break; default: @@ -1476,6 +1479,12 @@ void DiscordClient::HandleGatewayGuildJoinRequestDelete(const GatewayMessage &ms m_signal_guild_join_request_delete.emit(data); } +void DiscordClient::HandleGatewayRelationshipRemove(const GatewayMessage &msg) { + RelationshipRemoveData data = msg.Data; + m_user_relationships.erase(data.ID); + m_signal_relationship_remove.emit(data.ID, data.Type); +} + void DiscordClient::HandleGatewayReadySupplemental(const GatewayMessage &msg) { ReadySupplementalData data = msg.Data; for (const auto &p : data.MergedPresences.Friends) { @@ -1811,6 +1820,7 @@ void DiscordClient::LoadEventMap() { m_event_map["GUILD_JOIN_REQUEST_CREATE"] = GatewayEvent::GUILD_JOIN_REQUEST_CREATE; m_event_map["GUILD_JOIN_REQUEST_UPDATE"] = GatewayEvent::GUILD_JOIN_REQUEST_UPDATE; m_event_map["GUILD_JOIN_REQUEST_DELETE"] = GatewayEvent::GUILD_JOIN_REQUEST_DELETE; + m_event_map["RELATIONSHIP_REMOVE"] = GatewayEvent::RELATIONSHIP_REMOVE; } DiscordClient::type_signal_gateway_ready DiscordClient::signal_gateway_ready() { @@ -1933,6 +1943,10 @@ DiscordClient::type_signal_guild_join_request_delete DiscordClient::signal_guild return m_signal_guild_join_request_delete; } +DiscordClient::type_signal_relationship_remove DiscordClient::signal_relationship_remove() { + return m_signal_relationship_remove; +} + DiscordClient::type_signal_message_sent DiscordClient::signal_message_sent() { return m_signal_message_sent; } |