MDL-69411 core_message: Fix return structure for empty result set

Passing a timefrom higher than last message timecreated needs to
return a formatted response so it does not break ws.
This commit is contained in:
David Matamoros
2020-11-23 19:25:44 +01:00
parent 87bcff8c6e
commit e80e613f65
3 changed files with 88 additions and 1 deletions
+1 -1
View File
@@ -1312,7 +1312,7 @@ class api {
// The last known message time is earlier than the one being requested so we can
// just return an empty result set rather than having to query the DB.
if ($lastcreated && $lastcreated < $timefrom) {
return [];
return helper::format_conversation_messages($userid, $convid, []);
}
}