Merge branch 'staging' into offline2

pull/1/head
yflory 4 years ago
commit 7459e17e91

@ -55,12 +55,12 @@
} }
} }
.cp-app-contacts-spinner { span.cp-app-contacts-spinner {
display: none; display: none;
} }
.cp-app-contacts-initializing { .cp-app-contacts-initializing {
.cp-app-contacts-spinner { span.cp-app-contacts-spinner {
color: @cp_messenger-fg; color: @cp_messenger-fg;
display: block; display: block;
} }

@ -348,10 +348,7 @@ const getOlderHistory = function (data, cb) {
if (hash === oldestKnownHash) { if (hash === oldestKnownHash) {
found = true; found = true;
} }
messages.push({ messages.push(parsed);
msg: parsed,
hash: hash,
});
}, function (err) { }, function (err) {
var toSend = []; var toSend = [];
if (typeof (desiredMessages) === "number") { if (typeof (desiredMessages) === "number") {
@ -359,14 +356,14 @@ const getOlderHistory = function (data, cb) {
} else if (untilHash) { } else if (untilHash) {
for (var j = messages.length - 1; j >= 0; j--) { for (var j = messages.length - 1; j >= 0; j--) {
toSend.unshift(messages[j]); toSend.unshift(messages[j]);
if (messages[j] && messages[j].hash === untilHash) { if (Array.isArray(messages[j]) && HK.getHash(messages[j][4]) === untilHash) {
break; break;
} }
} }
} else { } else {
let cpCount = 0; let cpCount = 0;
for (var i = messages.length - 1; i >= 0; i--) { for (var i = messages.length - 1; i >= 0; i--) {
if (/^cp\|/.test(messages[i].msg[4]) && i !== (messages.length - 1)) { if (/^cp\|/.test(messages[i][4]) && i !== (messages.length - 1)) {
cpCount++; cpCount++;
} }
toSend.unshift(messages[i]); toSend.unshift(messages[i]);

Loading…
Cancel
Save