summaryrefslogtreecommitdiff
path: root/discord
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2021-02-18 12:45:14 -0500
committerouwou <26526779+ouwou@users.noreply.github.com>2021-02-18 12:45:14 -0500
commit4df9b148e2d7ca35a4de9acfd46daac597252709 (patch)
treed8e3a926c02e2f36cc9d555aa8851e1b2c812aa3 /discord
parent614c6ea59566441fdf91cc4329251b8b0a5561c0 (diff)
downloadabaddon-portaudio-4df9b148e2d7ca35a4de9acfd46daac597252709.tar.gz
abaddon-portaudio-4df9b148e2d7ca35a4de9acfd46daac597252709.zip
add option to remove user from group dm in menu
also fix a crash when opening empty group dms
Diffstat (limited to 'discord')
-rw-r--r--discord/discord.cpp6
-rw-r--r--discord/discord.hpp1
2 files changed, 7 insertions, 0 deletions
diff --git a/discord/discord.cpp b/discord/discord.cpp
index 0b97a8a..0055229 100644
--- a/discord/discord.cpp
+++ b/discord/discord.cpp
@@ -522,6 +522,12 @@ void DiscordClient::DeleteInvite(const std::string &code, sigc::slot<void(bool s
});
}
+void DiscordClient::RemoveGroupDMRecipient(Snowflake channel_id, Snowflake user_id) {
+ m_http.MakeDELETE("/channels/" + std::to_string(channel_id) + "/recipients/" + std::to_string(user_id), [this](const http::response_type &response) {
+ CheckCode(response);
+ });
+}
+
std::vector<BanData> DiscordClient::GetBansInGuild(Snowflake guild_id) {
return m_store.GetBans(guild_id);
}
diff --git a/discord/discord.hpp b/discord/discord.hpp
index 6ac714d..0fdf0e4 100644
--- a/discord/discord.hpp
+++ b/discord/discord.hpp
@@ -120,6 +120,7 @@ public:
void UnbanUser(Snowflake guild_id, Snowflake user_id, sigc::slot<void(bool success)> callback);
void DeleteInvite(const std::string &code);
void DeleteInvite(const std::string &code, sigc::slot<void(bool success)> callback);
+ void RemoveGroupDMRecipient(Snowflake channel_id, Snowflake user_id);
// FetchGuildBans fetches all bans+reasons via api, this func fetches stored bans (so usually just GUILD_BAN_ADD data)
std::vector<BanData> GetBansInGuild(Snowflake guild_id);