This commit is contained in:
Bruno Windels 2019-10-09 17:51:50 +02:00
parent 3e971e4880
commit 2d848bba29
25 changed files with 84 additions and 100 deletions

View file

@ -25,18 +25,18 @@ module.exports = class RestRoom {
}
async talk(message) {
this.log.step(`says "${message}" in ${this._roomId}`)
this.log.step(`says "${message}" in ${this._roomId}`);
const txId = uuidv4();
await this.session._put(`/rooms/${this._roomId}/send/m.room.message/${txId}`, {
"msgtype": "m.text",
"body": message
"body": message,
});
this.log.done();
return txId;
}
async leave() {
this.log.step(`leaves ${this._roomId}`)
this.log.step(`leaves ${this._roomId}`);
await this.session._post(`/rooms/${this._roomId}/leave`);
this.log.done();
}
@ -44,4 +44,4 @@ module.exports = class RestRoom {
roomId() {
return this._roomId;
}
}
};