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; return;
} }
console.log(`MATRIX ${name}: ${msg}`); console.log(`MATRIX ${name}: ${msg}`);
msg.split('\n').forEach((part) => { msg.split('\n')
let msgLine = part; .slice(0, 5)
while (msgLine.length > 190) { .filter((msg) => msg.trim() !== '')
const msgPart = msgLine.slice(0, 190); .forEach((part) => {
msgLine = msgLine.slice(190); let msgLine = part;
this.sendPPfun(name, parseInt(uid, 10), msgPart, cid); while (msgLine.length > 190) {
} const msgPart = msgLine.slice(0, 190);
this.sendPPfun(name, parseInt(uid, 10), msgLine, cid); msgLine = msgLine.slice(190);
}) this.sendPPfun(name, parseInt(uid, 10), msgPart, cid);
}
this.sendPPfun(name, parseInt(uid, 10), msgLine, cid);
});
return; return;
} }