diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-11-16 14:48:26 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-11-16 14:48:26 +0100 |
commit | 4e3a32ea4478e547215c6775313aaded3bc16b08 (patch) | |
tree | 12a01077e0d2997663995d7c56648e15c74cba93 /src/plugins | |
parent | 4eeaa5c2b889a22c23199247ccc87fb717e6cbcb (diff) |
Matrix: do not continuously fetch messages when currently showing pinned messages tab
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/Matrix.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp index b102cfa..9da6185 100644 --- a/src/plugins/Matrix.cpp +++ b/src/plugins/Matrix.cpp @@ -274,6 +274,7 @@ namespace QuickMedia { void RoomData::clear_data() { std::lock_guard<std::recursive_mutex> lock(room_mutex); //fetched_messages_by_event_id.clear(); + userdata = nullptr; user_info_by_user_id.clear(); messages.clear(); messages_read_index = 0; @@ -460,7 +461,9 @@ namespace QuickMedia { last_unread_message = last_new_message.get(); BodyItem *room_body_item = static_cast<BodyItem*>(room->userdata); - assert(room_body_item); + //assert(room_body_item); + if(!room_body_item) + return; if(last_unread_message) { std::string room_desc = "Unread: " + matrix->message_get_author_displayname(last_unread_message) + ": " + extract_first_line_elipses(last_unread_message->body, 150); |