summaryrefslogtreecommitdiff
path: root/src/components/chatwindow.cpp
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2022-06-05 21:41:57 -0400
committerouwou <26526779+ouwou@users.noreply.github.com>2022-06-05 21:41:57 -0400
commit270730d9b36c8fc3a221da7e565632c1432d41c6 (patch)
treeed67d9fcec4df6287f3dd13cb997297d6af50ec8 /src/components/chatwindow.cpp
parent4ec5c1dfccaa5ce3bce5dc22a95e91d781262345 (diff)
downloadabaddon-portaudio-270730d9b36c8fc3a221da7e565632c1432d41c6.tar.gz
abaddon-portaudio-270730d9b36c8fc3a221da7e565632c1432d41c6.zip
start attachments (image paste and upload)
Diffstat (limited to 'src/components/chatwindow.cpp')
-rw-r--r--src/components/chatwindow.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/components/chatwindow.cpp b/src/components/chatwindow.cpp
index 5aab4e6..46c34d4 100644
--- a/src/components/chatwindow.cpp
+++ b/src/components/chatwindow.cpp
@@ -45,6 +45,8 @@ ChatWindow::ChatWindow() {
m_topic_text.set_halign(Gtk::ALIGN_START);
m_topic_text.show();
+ m_input->set_valign(Gtk::ALIGN_END);
+
m_input->signal_submit().connect(sigc::mem_fun(*this, &ChatWindow::OnInputSubmit));
m_input->signal_escape().connect([this]() {
if (m_is_replying)
@@ -70,9 +72,6 @@ ChatWindow::ChatWindow() {
m_chat->signal_action_chat_load_history().connect([this](Snowflake id) {
m_signal_action_chat_load_history.emit(id);
});
- m_chat->signal_action_chat_submit().connect([this](const std::string &str, Snowflake channel_id, Snowflake referenced_id) {
- m_signal_action_chat_submit.emit(str, channel_id, referenced_id);
- });
m_chat->signal_action_insert_mention().connect([this](Snowflake id) {
// lowkey gross
m_signal_action_insert_mention.emit(id);
@@ -210,15 +209,15 @@ Snowflake ChatWindow::GetActiveChannel() const {
return m_active_channel;
}
-bool ChatWindow::OnInputSubmit(const Glib::ustring &text) {
+bool ChatWindow::OnInputSubmit(const Glib::ustring &text, const std::vector<std::string> &attachment_paths) {
if (!m_rate_limit_indicator->CanSpeak())
return false;
- if (text.empty())
+ if (text.empty() && attachment_paths.empty())
return false;
if (m_active_channel.IsValid())
- m_signal_action_chat_submit.emit(text, m_active_channel, m_replying_to); // m_replying_to is checked for invalid in the handler
+ m_signal_action_chat_submit.emit(text, attachment_paths, m_active_channel, m_replying_to); // m_replying_to is checked for invalid in the handler
if (m_is_replying)
StopReplying();