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,7 +201,10 @@ class PPfunMatrixBridge {
return;
}
console.log(`MATRIX ${name}: ${msg}`);
msg.split('\n').forEach((part) => {
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);
@ -209,7 +212,7 @@ class PPfunMatrixBridge {
this.sendPPfun(name, parseInt(uid, 10), msgPart, cid);
}
this.sendPPfun(name, parseInt(uid, 10), msgLine, cid);
})
});
return;
}