From 9b1bc8f14590db0cf460fd62a7eb856e02a531db Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Sun, 30 Aug 2020 22:55:36 -0400 Subject: add ability to edit messages --- abaddon.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'abaddon.cpp') diff --git a/abaddon.cpp b/abaddon.cpp index 954814a..0f2d0bd 100644 --- a/abaddon.cpp +++ b/abaddon.cpp @@ -4,6 +4,7 @@ #include #include "discord/discord.hpp" #include "dialogs/token.hpp" +#include "dialogs/editmessage.hpp" #include "abaddon.hpp" #ifdef _WIN32 @@ -205,6 +206,15 @@ void Abaddon::ActionChatDeleteMessage(Snowflake channel_id, Snowflake id) { m_discord.DeleteMessage(channel_id, id); } +void Abaddon::ActionChatEditMessage(Snowflake channel_id, Snowflake id) { + EditMessageDialog dlg(*m_main_window); + auto response = dlg.run(); + if (response == Gtk::RESPONSE_OK) { + auto new_content = dlg.GetContent(); + m_discord.EditMessage(channel_id, id, new_content); + } +} + int main(int argc, char **argv) { Gtk::Main::init_gtkmm_internals(); // why??? Abaddon abaddon; -- cgit v1.2.3