fix: bundle affiliation commands

This commit is contained in:
2023-02-23 15:41:05 +01:00
parent 7b81bf6db1
commit d26182fabc
+3 -5
View File
@@ -517,17 +517,15 @@ router.post('/creategroup', async function (req, res) {
// all good
console.log("setting owner to " + req.body.owner);
cmd = 'muc:room("' + req.body.jid + '"):set_affiliation(true, "' + req.body.owner + '", "owner");';
response = await connection.send(cmd);
console.log(response);
if (req.body.members && req.body.members.length > 0) {
for (var i = 0; i < req.body.members.length; i++) {
console.log("adding member " + req.body.members[i]);
cmd = 'muc:room("' + req.body.jid + '"):set_affiliation(true, "' + req.body.members[i] + '", "member");';
response = await connection.send(cmd);
console.log(response);
cmd += 'muc:room("' + req.body.jid + '"):set_affiliation(true, "' + req.body.members[i] + '", "member");';
}
}
response = await connection.send(cmd);
console.log(response);
//muc:room("testingtelnetcreate1_meeting@conference.microlab.zimbra-vnc.de"):set_affiliation(true, "richard.watson@microlab.zimbra-vnc.de", "member");
res.json({status: "ok"});