aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Matrix.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-02-09 15:37:13 +0100
committerdec05eba <dec05eba@protonmail.com>2021-02-09 15:37:13 +0100
commitcdab2f33dbc361eec1d6a90899a907e61a682f18 (patch)
treed748b4eae393f2bdc7f2618744f31d10c9b243ec /src/plugins/Matrix.cpp
parent2e22afbaa5c01d9aa40564a7646092455ce0d88c (diff)
Matrix: its all so tiresome
Diffstat (limited to 'src/plugins/Matrix.cpp')
-rw-r--r--src/plugins/Matrix.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp
index 50a2cd4..f97f574 100644
--- a/src/plugins/Matrix.cpp
+++ b/src/plugins/Matrix.cpp
@@ -500,19 +500,16 @@ namespace QuickMedia {
}
void MatrixQuickMedia::update_room_description(RoomData *room, Messages &new_messages, bool is_initial_sync, bool sync_is_cache) {
- time_t read_marker_message_timestamp = 0;
+ time_t read_marker_message_timestamp = room->last_read_message_timestamp;
std::shared_ptr<UserInfo> me = matrix->get_me(room);
std::string my_user_read_marker;
- if(me) {
+ if(me && read_marker_message_timestamp == 0) {
my_user_read_marker = room->get_user_read_marker(me);
auto read_marker_message = room->get_message_by_id(my_user_read_marker);
if(read_marker_message)
read_marker_message_timestamp = read_marker_message->timestamp;
}
- if(read_marker_message_timestamp == 0)
- read_marker_message_timestamp = room->last_read_message_timestamp;
-
std::shared_ptr<Message> last_new_message = get_last_message_by_timestamp(new_messages);
if(!last_new_message)
return;