Replace the keepAlive flag with request options

This commit is contained in:
Robin Townsend
2022-10-27 08:19:41 -04:00
parent dbdaa1540a
commit 4c6e1e5c21
3 changed files with 7 additions and 6 deletions
+2 -2
View File
@@ -212,7 +212,7 @@ describe('Group Call', function() {
],
}),
FAKE_USER_ID_1,
false,
{ keepAlive: false },
);
} finally {
groupCall.leave();
@@ -234,7 +234,7 @@ describe('Group Call', function() {
EventType.GroupCallMemberPrefix,
expect.objectContaining({ "m.calls": [] }),
FAKE_USER_ID_1,
true, // Request should outlive the window
{ keepAlive: true }, // Request should outlive the window
);
});
+4 -3
View File
@@ -65,6 +65,7 @@ import {
FileType,
UploadResponse,
HTTPError,
IRequestOpts,
} from "./http-api";
import {
Crypto,
@@ -7517,7 +7518,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
* @param {string} eventType
* @param {Object} content
* @param {string} stateKey
* @param {boolean} keepAlive Whether the request should outlive the window.
* @param {IRequestOpts} opts Options for the request function.
* @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response.
*/
@@ -7526,7 +7527,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
eventType: string,
content: any,
stateKey = "",
keepAlive = false,
opts: IRequestOpts = {},
): Promise<ISendEventResponse> {
const pathParams = {
$roomId: roomId,
@@ -7537,7 +7538,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
if (stateKey !== undefined) {
path = utils.encodeUri(path + "/$stateKey", pathParams);
}
return this.http.authedRequest(Method.Put, path, undefined, content, { keepAlive });
return this.http.authedRequest(Method.Put, path, undefined, content, opts);
}
/**
+1 -1
View File
@@ -762,7 +762,7 @@ export class GroupCall extends TypedEventEmitter<
};
return this.client.sendStateEvent(
this.room.roomId, EventType.GroupCallMemberPrefix, content, localUserId, keepAlive,
this.room.roomId, EventType.GroupCallMemberPrefix, content, localUserId, { keepAlive },
);
}