From ff85dfb6a9b58d6e5a25c614e7aa3e061c6a3e1f Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 20 Aug 2021 00:54:13 +0200 Subject: List all notifications in notifications page (including the ones we get after starting up qm). This was caused by notifications body being overwritten with cache when navigating to it --- src/QuickMedia.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/QuickMedia.cpp') diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index 8fd6b0b..a00f056 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -1674,6 +1674,8 @@ namespace QuickMedia { if(matrix->did_initial_sync_fail(err_msg)) { show_notification("QuickMedia", "Initial matrix sync failed, error: " + err_msg, Urgency::CRITICAL); matrix->logout(); + delete matrix; + matrix = new Matrix(); current_page = PageType::CHAT_LOGIN; chat_login_page(); after_matrix_login_page(); @@ -6356,6 +6358,8 @@ namespace QuickMedia { new_page = PageType::CHAT; matrix->stop_sync(); matrix->logout(); + delete matrix; + matrix = new Matrix(); // TODO: Instead of doing this, exit this current function and navigate to chat login page instead. //delete current_plugin; //current_plugin = new Matrix(); @@ -6767,6 +6771,8 @@ namespace QuickMedia { all_messages.clear(); show_notification("QuickMedia", "Initial matrix sync failed, error: " + err_msg, Urgency::CRITICAL); matrix->logout(); + delete matrix; + matrix = new Matrix(); current_page = PageType::CHAT_LOGIN; chat_login_page(); after_matrix_login_page(); @@ -6801,6 +6807,8 @@ namespace QuickMedia { all_messages.clear(); show_notification("QuickMedia", "Initial matrix sync failed, error: " + err_msg, Urgency::CRITICAL); matrix->logout(); + delete matrix; + matrix = new Matrix(); current_page = PageType::CHAT_LOGIN; chat_login_page(); after_matrix_login_page(); @@ -6824,6 +6832,11 @@ namespace QuickMedia { add_new_messages_to_current_room(all_messages_new); modify_related_messages_in_current_room(all_messages_new); unresolved_reactions.clear(); + after_token.clear(); + before_token.clear(), + fetched_enough_messages_top = false; + fetched_enough_messages_bottom = false; + fetch_messages_future.cancel(); process_reactions(all_messages_new); if(current_room->initial_prev_messages_fetch) { current_room->initial_prev_messages_fetch = false; -- cgit v1.2.3