Changeset View
Changeset View
Standalone View
Standalone View
apps/ecash-herald/src/telegram.js
Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | splitOverflowTgMsg: function (tgMsgArray) { | ||||
if (thisTgMsgStringLength - 2 > TG_MSG_MAX_LENGTH) { | if (thisTgMsgStringLength - 2 > TG_MSG_MAX_LENGTH) { | ||||
// Build a msg string with preceding lines, i.e. do not include this i'th line | // Build a msg string with preceding lines, i.e. do not include this i'th line | ||||
const sliceEndIndex = i; // Note that the slice end index is not included | const sliceEndIndex = i; // Note that the slice end index is not included | ||||
tgMsgStrings.push( | tgMsgStrings.push( | ||||
tgMsgArray.slice(sliceStartIndex, sliceEndIndex).join('\n'), | tgMsgArray.slice(sliceStartIndex, sliceEndIndex).join('\n'), | ||||
); | ); | ||||
// Reset sliceStartIndex and thisTgMsgStringLength for the next message | // Reset sliceStartIndex and thisTgMsgStringLength for the next message | ||||
sliceStartIndex = sliceEndIndex; | sliceStartIndex = sliceEndIndex; | ||||
thisTgMsgStringLength = 0; | // You will be including this 'i'th line in the next batch, don't reset to zero | ||||
Fabien: I don't understand this change. It also seems unrelated to the diff? | |||||
bytesofmanAuthorUnsubmitted Done Inline ActionsUnrelated to the diff except that the bug was discovered by the changes to the msgs in this diff bytesofman: D13865
Unrelated to the diff except that the bug was discovered by the changes to the msgs in… | |||||
thisTgMsgStringLength = thisLine.length + 2; | |||||
} | } | ||||
} | } | ||||
// Build a tg msg of all unused lines, if you have them | // Build a tg msg of all unused lines, if you have them | ||||
if (sliceStartIndex < tgMsgArray.length) { | if (sliceStartIndex < tgMsgArray.length) { | ||||
tgMsgStrings.push(tgMsgArray.slice(sliceStartIndex).join('\n')); | tgMsgStrings.push(tgMsgArray.slice(sliceStartIndex).join('\n')); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 60 Lines • Show Last 20 Lines |
I don't understand this change. It also seems unrelated to the diff?