Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6980,6 +6980,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
*/
public async doesServerSupportExtendedProfiles(): Promise<boolean> {
return (
(await this.isVersionSupported("v1.16")) ||
(await this.doesServerSupportUnstableFeature(UNSTABLE_MSC4133_EXTENDED_PROFILES)) ||
(await this.doesServerSupportUnstableFeature(STABLE_MSC4133_EXTENDED_PROFILES))
);
Expand All @@ -6991,7 +6992,10 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
* @returns The prefix for use with `authedRequest`
*/
private async getExtendedProfileRequestPrefix(): Promise<string> {
if (await this.doesServerSupportUnstableFeature("uk.tcpip.msc4133.stable")) {
if (
(await this.isVersionSupported("v1.16")) ||
(await this.doesServerSupportUnstableFeature("uk.tcpip.msc4133.stable"))
) {
return ClientPrefix.V3;
}
return "/_matrix/client/unstable/uk.tcpip.msc4133";
Expand Down
25 changes: 25 additions & 0 deletions src/models/profile-keys.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,33 @@
/*
Copyright 2025 The Matrix.org Foundation C.I.C.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

/**
* The timezone the user is currently in. The value of this property should
* match a timezone provided in https://www.iana.org/time-zones.
*
* This key was introduced in Matrix v1.16.
*/
export const ProfileKeyTimezone = "m.tz";

/**
* The timezone the user is currently in. The value of this property should
* match a timezone provided in https://www.iana.org/time-zones.
*
* @see https://github.com/matrix-org/matrix-spec-proposals/blob/clokep/profile-tz/proposals/4175-profile-field-time-zone.md
* @experimental
* @deprecated Unstable MSC field - Use `ProfileKeyTimezone`
*/
export const ProfileKeyMSC4175Timezone = "us.cloke.msc4175.tz";
4 changes: 4 additions & 0 deletions src/serverCapabilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ export interface Capabilities {
"m.set_displayname"?: ISetDisplayNameCapability;
"m.set_avatar_url"?: ISetAvatarUrlCapability;
"uk.tcpip.msc4133.profile_fields"?: IProfileFieldsCapability;
/**
* Since Matrix v1.16
*/
"m.profile_fields"?: IProfileFieldsCapability;
}

type CapabilitiesResponse = {
Expand Down