diff options
-rw-r--r-- | src/plugins/Matrix.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp index 86dfb3e..f62088a 100644 --- a/src/plugins/Matrix.cpp +++ b/src/plugins/Matrix.cpp @@ -385,15 +385,8 @@ namespace QuickMedia { } // TODO: this wont always work because we dont display all types of messages from server, such as "joined", "left", "kicked", "banned", "changed avatar", "changed display name", etc. - // TODO: Binary search? Message *last_unread_message = nullptr; - for(auto it = messages.rbegin(), end = messages.rend(); it != end; ++it) { - if((*it)->timestamp > read_marker_message_timestamp) { - last_unread_message = (*it).get(); - break; - } - } - if(!last_unread_message && !messages.empty() && messages.back()->timestamp > read_marker_message_timestamp) + if(!messages.empty() && messages.back()->timestamp > read_marker_message_timestamp) last_unread_message = messages.back().get(); BodyItem *room_body_item = static_cast<BodyItem*>(room->userdata); @@ -997,8 +990,9 @@ namespace QuickMedia { set_next_batch(next_batch_json->GetString()); fprintf(stderr, "Matrix: next batch: %s\n", next_batch.c_str()); } else { - set_next_batch("Invalid"); + //set_next_batch("Invalid"); fprintf(stderr, "Matrix: missing next batch\n"); + goto sync_end; } if(initial_sync) { |