|
|
@ -672,6 +672,7 @@ const handleGetHistoryRange = function (Env, Server, seq, userId, parsed) {
|
|
|
|
|
|
|
|
|
|
|
|
if (!Array.isArray(messages)) { messages = []; }
|
|
|
|
if (!Array.isArray(messages)) { messages = []; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// FIXME this reduction could be done in the worker instead of the main process
|
|
|
|
var toSend = [];
|
|
|
|
var toSend = [];
|
|
|
|
if (typeof (desiredMessages) === "number") {
|
|
|
|
if (typeof (desiredMessages) === "number") {
|
|
|
|
toSend = messages.slice(-desiredMessages);
|
|
|
|
toSend = messages.slice(-desiredMessages);
|
|
|
|