aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/chat_input
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/ui/chat_input')
-rw-r--r--main/src/ui/chat_input/chat_input_controller.vala15
1 files changed, 8 insertions, 7 deletions
diff --git a/main/src/ui/chat_input/chat_input_controller.vala b/main/src/ui/chat_input/chat_input_controller.vala
index 92a12bc9..d9608a85 100644
--- a/main/src/ui/chat_input/chat_input_controller.vala
+++ b/main/src/ui/chat_input/chat_input_controller.vala
@@ -135,6 +135,12 @@ public class ChatInputController : Object {
}
string text = chat_input.chat_text_view.text_view.buffer.text;
+ ContentItem? quoted_content_item_bak = quoted_content_item;
+
+ // Reset input state. Has do be done before parsing commands, because those directly return.
+ chat_input.chat_text_view.text_view.buffer.text = "";
+ chat_input.unset_quoted_message();
+ quoted_content_item = null;
if (text.has_prefix("/")) {
string[] token = text.split(" ", 2);
@@ -189,15 +195,10 @@ public class ChatInputController : Object {
}
}
Message out_message = stream_interactor.get_module(MessageProcessor.IDENTITY).create_out_message(text, conversation);
- if (quoted_content_item != null) {
- stream_interactor.get_module(Replies.IDENTITY).set_message_is_reply_to(out_message, quoted_content_item);
+ if (quoted_content_item_bak != null) {
+ stream_interactor.get_module(Replies.IDENTITY).set_message_is_reply_to(out_message, quoted_content_item_bak);
}
stream_interactor.get_module(MessageProcessor.IDENTITY).send_message(out_message, conversation);
-
- // Reset input state
- chat_input.chat_text_view.text_view.buffer.text = "";
- chat_input.unset_quoted_message();
- quoted_content_item = null;
}
private void on_text_input_changed() {