Skip to content

Commit e885ecf

Browse files
authored
Stabilise extended profiles (now part of Matrix v1.16) (#5013)
* Stabilise extended profiles (v1.16) * lint * Add capacity * Update profile keys * copyright * lint
1 parent d1d9aba commit e885ecf

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed

src/client.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6980,6 +6980,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
69806980
*/
69816981
public async doesServerSupportExtendedProfiles(): Promise<boolean> {
69826982
return (
6983+
(await this.isVersionSupported("v1.16")) ||
69836984
(await this.doesServerSupportUnstableFeature(UNSTABLE_MSC4133_EXTENDED_PROFILES)) ||
69846985
(await this.doesServerSupportUnstableFeature(STABLE_MSC4133_EXTENDED_PROFILES))
69856986
);
@@ -6991,7 +6992,10 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
69916992
* @returns The prefix for use with `authedRequest`
69926993
*/
69936994
private async getExtendedProfileRequestPrefix(): Promise<string> {
6994-
if (await this.doesServerSupportUnstableFeature("uk.tcpip.msc4133.stable")) {
6995+
if (
6996+
(await this.isVersionSupported("v1.16")) ||
6997+
(await this.doesServerSupportUnstableFeature("uk.tcpip.msc4133.stable"))
6998+
) {
69956999
return ClientPrefix.V3;
69967000
}
69977001
return "/_matrix/client/unstable/uk.tcpip.msc4133";

src/models/profile-keys.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,33 @@
1+
/*
2+
Copyright 2025 The Matrix.org Foundation C.I.C.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
/**
18+
* The timezone the user is currently in. The value of this property should
19+
* match a timezone provided in https://www.iana.org/time-zones.
20+
*
21+
* This key was introduced in Matrix v1.16.
22+
*/
23+
export const ProfileKeyTimezone = "m.tz";
24+
125
/**
226
* The timezone the user is currently in. The value of this property should
327
* match a timezone provided in https://www.iana.org/time-zones.
428
*
529
* @see https://github.com/matrix-org/matrix-spec-proposals/blob/clokep/profile-tz/proposals/4175-profile-field-time-zone.md
630
* @experimental
31+
* @deprecated Unstable MSC field - Use `ProfileKeyTimezone`
732
*/
833
export const ProfileKeyMSC4175Timezone = "us.cloke.msc4175.tz";

src/serverCapabilities.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ export interface Capabilities {
6464
"m.set_displayname"?: ISetDisplayNameCapability;
6565
"m.set_avatar_url"?: ISetAvatarUrlCapability;
6666
"uk.tcpip.msc4133.profile_fields"?: IProfileFieldsCapability;
67+
/**
68+
* Since Matrix v1.16
69+
*/
70+
"m.profile_fields"?: IProfileFieldsCapability;
6771
}
6872

6973
type CapabilitiesResponse = {

0 commit comments

Comments
 (0)