aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/Matrix.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp
index 0bb3e7b..58a90c9 100644
--- a/src/plugins/Matrix.cpp
+++ b/src/plugins/Matrix.cpp
@@ -576,8 +576,9 @@ namespace QuickMedia {
read_marker_message_timestamp = read_marker_message->timestamp;
}
- if(read_marker_message_timestamp == 0 || read_marker_message_timestamp < room->read_marker_event_timestamp)
- read_marker_message_timestamp = room->read_marker_event_timestamp;
+ const int64_t qm_read_marker = room->read_marker_event_timestamp;
+ if(read_marker_message_timestamp == 0 || read_marker_message_timestamp < qm_read_marker)
+ read_marker_message_timestamp = qm_read_marker;
std::shared_ptr<Message> last_new_message = get_last_message_by_timestamp(new_messages);
if(!last_new_message)
@@ -2022,6 +2023,11 @@ namespace QuickMedia {
read_marker_message_timestamp = read_marker_message->timestamp;
}
+ // TODO: Make sure |events_set_user_read_marker| is called before |events_add_messages| so this is set
+ const int64_t qm_read_marker = room_data->read_marker_event_timestamp;
+ if(read_marker_message_timestamp == 0 || read_marker_message_timestamp < qm_read_marker)
+ read_marker_message_timestamp = qm_read_marker;
+
for(auto &message : new_messages) {
// TODO: Is @room ok? shouldn't we also check if the user has permission to do @room? (only when notifications are limited to @mentions)
// TODO: Is comparing against read marker timestamp ok enough?