mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
network calls to accept and reject invite
This commit is contained in:
parent
bb1c64e1ac
commit
5ce138539b
@ -185,6 +185,14 @@ export class HomeServerApi {
|
|||||||
getPushers(options = null) {
|
getPushers(options = null) {
|
||||||
return this._get("/pushers", null, null, options);
|
return this._get("/pushers", null, null, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
join(roomId, options = null) {
|
||||||
|
return this._post(`/rooms/${encodeURIComponent(roomId)}/join`, null, null, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
leave(roomId, options = null) {
|
||||||
|
return this._post(`/rooms/${encodeURIComponent(roomId)}/leave`, null, null, options);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
import {Request as MockRequest} from "../../mocks/Request.js";
|
import {Request as MockRequest} from "../../mocks/Request.js";
|
||||||
|
@ -70,11 +70,13 @@ export class Invite extends EventEmitter {
|
|||||||
async accept() {
|
async accept() {
|
||||||
this._accepting = true;
|
this._accepting = true;
|
||||||
this._emitChange("accepting");
|
this._emitChange("accepting");
|
||||||
|
await this._hsApi.join(this._roomId).response();
|
||||||
}
|
}
|
||||||
|
|
||||||
async reject() {
|
async reject() {
|
||||||
this._rejecting = true;
|
this._rejecting = true;
|
||||||
this._emitChange("rejecting");
|
this._emitChange("rejecting");
|
||||||
|
await this._hsApi.leave(this._roomId).response();
|
||||||
}
|
}
|
||||||
|
|
||||||
get accepting() {
|
get accepting() {
|
||||||
|
Loading…
Reference in New Issue
Block a user