limit amount lines sent from natrix to 4

This commit is contained in:
HF 2023-05-31 15:28:31 +02:00
parent b66e2ba839
commit a7619c447f

View File

@ -201,15 +201,18 @@ class PPfunMatrixBridge {
return;
}
console.log(`MATRIX ${name}: ${msg}`);
msg.split('\n').forEach((part) => {
let msgLine = part;
while (msgLine.length > 190) {
const msgPart = msgLine.slice(0, 190);
msgLine = msgLine.slice(190);
this.sendPPfun(name, parseInt(uid, 10), msgPart, cid);
}
this.sendPPfun(name, parseInt(uid, 10), msgLine, cid);
})
msg.split('\n')
.slice(0, 5)
.filter((msg) => msg.trim() !== '')
.forEach((part) => {
let msgLine = part;
while (msgLine.length > 190) {
const msgPart = msgLine.slice(0, 190);
msgLine = msgLine.slice(190);
this.sendPPfun(name, parseInt(uid, 10), msgPart, cid);
}
this.sendPPfun(name, parseInt(uid, 10), msgLine, cid);
});
return;
}