diff options
author | dec05eba <dec05eba@protonmail.com> | 2022-11-16 02:48:21 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2022-11-16 02:48:21 +0100 |
commit | 82eea06a77a2c38d33cdabc0a1e74c0fae9b197e (patch) | |
tree | 8198894fc47758c93e17eb5c05cb3c321a17fd3e | |
parent | 48e407c2bd7b7c62ce747392ca2bda50d63c1fe9 (diff) |
Matrix: unfuck year 2500 provisional message timestamp read marker
-rw-r--r-- | src/QuickMedia.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index ae3d720..7e37214 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -7612,7 +7612,7 @@ namespace QuickMedia { for(; last_timeline_message >= 0; --last_timeline_message) { BodyItem *item = body_items[last_timeline_message].get(); Message *message = static_cast<Message*>(item->userdata); - if(message && message_is_timeline(message) && !message->event_id.empty()) + if(message && message_is_timeline(message) && !message->event_id.empty() && message->timestamp != timestamp_provisional_event) break; } @@ -7627,7 +7627,8 @@ namespace QuickMedia { Message *read_message = get_latest_message_in_edit_chain(static_cast<Message*>(body_items[last_timeline_message]->userdata)); // TODO: What if two messages have the same timestamp? - if(!read_message->event_id.empty() && read_message->timestamp > current_room->last_read_message_timestamp) { + // Oops, fuckup. If provisional timestamp then overwrite it. + if(!read_message->event_id.empty() && (read_message->timestamp > current_room->last_read_message_timestamp || current_room->last_message_timestamp == timestamp_provisional_event)) { matrix_chat_page->set_room_as_read(current_room); current_room->last_read_message_timestamp = read_message->timestamp; // TODO: What if the message is no longer valid? |