diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2020-09-06 23:34:29 -0400 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2020-09-06 23:34:29 -0400 |
commit | 3832ff9a15f448ba15d60e91b949f21d3295fc24 (patch) | |
tree | f234cfca33fa730c19db7030a3c95ee706e9e30d /abaddon.cpp | |
parent | 66cc4b3cc7c7170bd7ff0347ed377d317dcdce91 (diff) | |
download | abaddon-portaudio-3832ff9a15f448ba15d60e91b949f21d3295fc24.tar.gz abaddon-portaudio-3832ff9a15f448ba15d60e91b949f21d3295fc24.zip |
DiscordClient uses signals now
Diffstat (limited to 'abaddon.cpp')
-rw-r--r-- | abaddon.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/abaddon.cpp b/abaddon.cpp index 706e315..236a4a6 100644 --- a/abaddon.cpp +++ b/abaddon.cpp @@ -13,8 +13,14 @@ Abaddon::Abaddon() : m_settings("abaddon.ini") { - m_discord.SetAbaddon(this); LoadFromSettings(); + + m_discord.signal_gateway_ready().connect(sigc::mem_fun(*this, &Abaddon::DiscordOnReady)); + m_discord.signal_channel_list_refresh().connect(sigc::mem_fun(*this, &Abaddon::DiscordOnChannelListRefresh)); + m_discord.signal_message_create().connect(sigc::mem_fun(*this, &Abaddon::DiscordOnMessageCreate)); + m_discord.signal_message_delete().connect(sigc::mem_fun(*this, &Abaddon::DiscordOnMessageDelete)); + m_discord.signal_message_update().connect(sigc::mem_fun(*this, &Abaddon::DiscordOnMessageUpdate)); + m_discord.signal_guild_member_list_update().connect(sigc::mem_fun(*this, &Abaddon::DiscordOnGuildMemberListUpdate)); } Abaddon::~Abaddon() { @@ -81,27 +87,27 @@ const DiscordClient &Abaddon::GetDiscordClient() const { return m_discord; } -void Abaddon::DiscordNotifyReady() { +void Abaddon::DiscordOnReady() { m_main_window->UpdateComponents(); } -void Abaddon::DiscordNotifyChannelListFullRefresh() { +void Abaddon::DiscordOnChannelListRefresh() { m_main_window->UpdateChannelListing(); } -void Abaddon::DiscordNotifyMessageCreate(Snowflake id) { +void Abaddon::DiscordOnMessageCreate(Snowflake id) { m_main_window->UpdateChatNewMessage(id); } -void Abaddon::DiscordNotifyMessageDelete(Snowflake id, Snowflake channel_id) { +void Abaddon::DiscordOnMessageDelete(Snowflake id, Snowflake channel_id) { m_main_window->UpdateChatMessageDeleted(id, channel_id); } -void Abaddon::DiscordNotifyMessageUpdateContent(Snowflake id, Snowflake channel_id) { +void Abaddon::DiscordOnMessageUpdate(Snowflake id, Snowflake channel_id) { m_main_window->UpdateChatMessageEditContent(id, channel_id); } -void Abaddon::DiscordNotifyGuildMemberListUpdate(Snowflake guild_id) { +void Abaddon::DiscordOnGuildMemberListUpdate(Snowflake guild_id) { m_main_window->UpdateMembers(); } |