added msg deletion support

This commit is contained in:
unknown 2021-08-12 09:42:12 +05:30
parent 80d4a2b242
commit 3453451df9
3 changed files with 40 additions and 5 deletions

View file

@ -189,6 +189,19 @@ async function invite(roomId, userId) {
}
}
async function redact(roomId, eventId, reason) {
const mx = initMatrix.matrixClient;
try {
await mx.redactEvent(roomId, eventId, undefined, typeof reason === 'undefined' ? undefined : { reason });
return true;
} catch (e) {
throw new Error(e);
}
}
export {
join, leave, create, invite,
join, leave,
create, invite,
redact,
};