add ability to edit messages

This commit is contained in:
ouwou
2020-08-30 22:55:36 -04:00
parent 44b7989f50
commit 9b1bc8f145
12 changed files with 120 additions and 1 deletions

View File

@@ -4,6 +4,7 @@
#include <algorithm>
#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;