aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/Matrix.hpp1
-rw-r--r--src/QuickMedia.cpp8
2 files changed, 3 insertions, 6 deletions
diff --git a/plugins/Matrix.hpp b/plugins/Matrix.hpp
index 68081d8..de66481 100644
--- a/plugins/Matrix.hpp
+++ b/plugins/Matrix.hpp
@@ -238,6 +238,7 @@ namespace QuickMedia {
int notification_power_level = 50;
size_t index = 0;
std::atomic<uint64_t> gpg_decrypt_message_id = 0;
+ std::string chat_message;
private:
std::mutex user_mutex;
std::recursive_mutex room_mutex;
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index 99e68df..7b052f4 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -6011,6 +6011,7 @@ namespace QuickMedia {
Entry chat_input("Press i to start writing a message...", &rounded_rectangle_shader);
chat_input.set_editable(false);
chat_input.set_padding_scale(1.5f);
+ chat_input.set_text(current_room->chat_message);
struct ProvisionalMessage {
std::shared_ptr<BodyItem> body_item;
@@ -7438,7 +7439,6 @@ namespace QuickMedia {
mention.hide();
} else {
chat_input.set_editable(false);
- chat_input.set_text("");
chat_state = ChatState::NAVIGATING;
currently_operating_on_item = nullptr;
if(typing && current_room) {
@@ -7512,11 +7512,6 @@ namespace QuickMedia {
if(chat_state == ChatState::REPLYING)
chat_input.set_editable(true);
} else {
- mention.hide();
- chat_input.set_editable(false);
- chat_input.set_text("");
- chat_state = ChatState::NAVIGATING;
- currently_operating_on_item = nullptr;
if(typing && current_room) {
fprintf(stderr, "Stopped typing\n");
typing = false;
@@ -7968,6 +7963,7 @@ namespace QuickMedia {
}
chat_page_end:
+ current_room->chat_message = chat_input.get_text();
matrix_chat_page->set_current_room(nullptr, nullptr, nullptr);
fetch_messages_future.cancel();
cleanup_tasks();