diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2022-06-14 02:36:04 -0400 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2022-06-14 02:36:04 -0400 |
commit | 4456c8771da668cbadb411583624fe0e357fa687 (patch) | |
tree | 789e2d73e6f0994b314b8e18c9cb8209562666e2 /src/components/chatwindow.cpp | |
parent | caa551a4693c7c7ef475be515b31eb025bc7df96 (diff) | |
download | abaddon-portaudio-4456c8771da668cbadb411583624fe0e357fa687.tar.gz abaddon-portaudio-4456c8771da668cbadb411583624fe0e357fa687.zip |
refactor send message params into one struct
Diffstat (limited to 'src/components/chatwindow.cpp')
-rw-r--r-- | src/components/chatwindow.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/components/chatwindow.cpp b/src/components/chatwindow.cpp index 52c2a60..3e1885b 100644 --- a/src/components/chatwindow.cpp +++ b/src/components/chatwindow.cpp @@ -212,15 +212,18 @@ Snowflake ChatWindow::GetActiveChannel() const { return m_active_channel; } -bool ChatWindow::OnInputSubmit(const Glib::ustring &text, const std::vector<std::string> &attachment_paths) { +bool ChatWindow::OnInputSubmit(ChatSubmitParams data) { if (!m_rate_limit_indicator->CanSpeak()) return false; - if (text.empty() && attachment_paths.empty()) + if (data.Message.empty() && data.Attachments.empty()) return false; + data.ChannelID = m_active_channel; + data.InReplyToID = m_replying_to; + if (m_active_channel.IsValid()) - 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 + m_signal_action_chat_submit.emit(data); // m_replying_to is checked for invalid in the handler if (m_is_replying) StopReplying(); |