diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/Matrix.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp index 6e6264f..75e293a 100644 --- a/src/plugins/Matrix.cpp +++ b/src/plugins/Matrix.cpp @@ -3719,7 +3719,7 @@ namespace QuickMedia { const rapidjson::Value &end_json = GetMember(json_root, "end"); if(!end_json.IsString()) { - room_data->set_prev_batch("invalid"); + room_data->set_prev_batch(""); fprintf(stderr, "Warning: matrix messages response is missing 'end', this could happen if we received the very first messages in the room\n"); if(reached_end) *reached_end = true; @@ -4970,7 +4970,12 @@ namespace QuickMedia { } const rapidjson::Value &errcode_json = GetMember(json_root, "errcode"); - if(errcode_json.IsString() && strcmp(errcode_json.GetString(), "M_NOT_FOUND") != 0) { + if(errcode_json.IsString()) { + // This is the case if the room has never set pinned events. + // After a pinned event has added and then removed so the list is empty then an empty list is returned instead. + if(strcmp(errcode_json.GetString(), "M_NOT_FOUND") == 0) + return PluginResult::OK; + const rapidjson::Value &error_json = GetMember(json_root, "error"); if(error_json.IsString()) { show_notification("QuickMedia", "Failed to get pinned events for room " + room->id + ", error: " + std::string(error_json.GetString(), error_json.GetStringLength()), Urgency::CRITICAL); |