From 03e617a146666ad95f8cf9ff144f1cec4ae4c6cd Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Sat, 15 Jul 2023 16:03:33 -0400 Subject: only start editing if input is empty --- src/components/chatinput.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/components/chatinput.cpp') diff --git a/src/components/chatinput.cpp b/src/components/chatinput.cpp index c88de49..f53c6fe 100644 --- a/src/components/chatinput.cpp +++ b/src/components/chatinput.cpp @@ -579,6 +579,10 @@ void ChatInput::StopEditing() { m_input.Get().get_style_context()->remove_class("editing"); } +bool ChatInput::IsEmpty() { + return GetBuffer()->get_char_count() == 0; +} + bool ChatInput::AddFileAsImageAttachment(const Glib::RefPtr &file) { try { const auto read_stream = file->read(); -- cgit v1.2.3