Skip to content

Commit 0210106

Browse files
toger5AndrewFerr
andauthored
Add fetching the well known in embedded mode. (#4259)
* Add fetching the well known in embedded mode. This is used to load the focus from the well known in elment-call. * revert what we dont want in this PR. * Update src/client.ts Co-authored-by: Andrew Ferrazzutti <[email protected]> --------- Co-authored-by: Andrew Ferrazzutti <[email protected]>
1 parent 3e05a71 commit 0210106

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7410,7 +7410,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
74107410
return this.http.authedRequest(Method.Post, path, undefined, undefined, { prefix: "" });
74117411
}
74127412

7413-
private async fetchClientWellKnown(): Promise<void> {
7413+
protected async fetchClientWellKnown(): Promise<void> {
74147414
// `getRawClientConfig` does not throw or reject on network errors, instead
74157415
// it absorbs errors and returns `{}`.
74167416
this.clientWellKnownPromise = AutoDiscovery.getRawClientConfig(this.getDomain() ?? undefined);

src/embedded.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,14 @@ export class RoomWidgetClient extends MatrixClient {
218218
});
219219
}) ?? [],
220220
);
221+
222+
if (opts.clientWellKnownPollPeriod !== undefined) {
223+
this.clientWellKnownIntervalID = setInterval(() => {
224+
this.fetchClientWellKnown();
225+
}, 1000 * opts.clientWellKnownPollPeriod);
226+
this.fetchClientWellKnown();
227+
}
228+
221229
this.setSyncState(SyncState.Syncing);
222230
logger.info("Finished backfilling events");
223231

0 commit comments

Comments
 (0)