aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-11-07 12:19:46 +0100
committerdec05eba <dec05eba@protonmail.com>2020-11-07 12:19:46 +0100
commit9ce78a45ad14bba4a3caf554d589f4b3ce5f4050 (patch)
treef95c5e250d56ecfe4c48f3c923425925bc08fe02
parentf970cef325d94335b13240941c95a12c58f9ccb3 (diff)
Shit
-rw-r--r--src/plugins/Matrix.cpp12
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) {