From a8e35756f9e2b2a94d76c88e699692aef05555a9 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 5 Dec 2020 06:09:05 +0100 Subject: Matrix: scroll to bottom when receiving previous messages and no visible messages, fix thumbnail size json crash --- src/plugins/Matrix.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/plugins/Matrix.cpp') diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp index a7d50d0..f8a88b1 100644 --- a/src/plugins/Matrix.cpp +++ b/src/plugins/Matrix.cpp @@ -1401,7 +1401,7 @@ namespace QuickMedia { const rapidjson::Value &unread_notification_json = GetMember(it.value, "unread_notifications"); if(unread_notification_json.IsObject() && !is_additional_messages_sync) { const rapidjson::Value &highlight_count_json = GetMember(unread_notification_json, "highlight_count"); - if(highlight_count_json.IsNumber() && (highlight_count_json.GetInt64() > 0 || initial_sync)) { + if(highlight_count_json.IsInt64() && (highlight_count_json.GetInt64() > 0 || initial_sync)) { room->unread_notification_count = highlight_count_json.GetInt64(); if(highlight_count_json.GetInt64() > 0) has_unread_notifications = true; @@ -1588,7 +1588,7 @@ namespace QuickMedia { bool found_resolution = false; const rapidjson::Value &w_json = GetMember(info_json, "w"); const rapidjson::Value &h_json = GetMember(info_json, "h"); - if(w_json.IsNumber() && h_json.IsNumber()) { + if(w_json.IsInt() && h_json.IsInt()) { thumbnail_size.x = w_json.GetInt(); thumbnail_size.y = h_json.GetInt(); found_resolution = true; @@ -1598,7 +1598,7 @@ namespace QuickMedia { if(thumbnail_info_json.IsObject()) { const rapidjson::Value &w_json = GetMember(thumbnail_info_json, "w"); const rapidjson::Value &h_json = GetMember(thumbnail_info_json, "h"); - if(w_json.IsNumber() && h_json.IsNumber()) { + if(w_json.IsInt() && h_json.IsInt()) { thumbnail_size.x = w_json.GetInt(); thumbnail_size.y = h_json.GetInt(); found_resolution = true; @@ -1762,7 +1762,7 @@ namespace QuickMedia { time_t timestamp = 0; const rapidjson::Value &origin_server_ts = GetMember(event_item_json, "origin_server_ts"); - if(origin_server_ts.IsNumber()) + if(origin_server_ts.IsInt64()) timestamp = origin_server_ts.GetInt64(); const rapidjson::Value &type_json = GetMember(event_item_json, "type"); @@ -2236,7 +2236,7 @@ namespace QuickMedia { continue; const rapidjson::Value ×tamp_json = GetMember(event_json, "origin_server_ts"); - if(!timestamp_json.IsNumber()) + if(!timestamp_json.IsInt64()) continue; const rapidjson::Value &membership_json = GetMember(content_json, "membership"); @@ -3391,7 +3391,7 @@ namespace QuickMedia { return PluginResult::ERR; const rapidjson::Value &upload_size_json = GetMember(json_root, "m.upload.size"); - if(!upload_size_json.IsNumber()) + if(!upload_size_json.IsInt()) return PluginResult::ERR; upload_limit = upload_size_json.GetInt(); -- cgit v1.2.3