You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-12-16 09:42:23 +03:00
Stabilise extended profiles (now part of Matrix v1.16) (#5013)
* Stabilise extended profiles (v1.16) * lint * Add capacity * Update profile keys * copyright * lint
This commit is contained in:
@@ -6980,6 +6980,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
|
|||||||
*/
|
*/
|
||||||
public async doesServerSupportExtendedProfiles(): Promise<boolean> {
|
public async doesServerSupportExtendedProfiles(): Promise<boolean> {
|
||||||
return (
|
return (
|
||||||
|
(await this.isVersionSupported("v1.16")) ||
|
||||||
(await this.doesServerSupportUnstableFeature(UNSTABLE_MSC4133_EXTENDED_PROFILES)) ||
|
(await this.doesServerSupportUnstableFeature(UNSTABLE_MSC4133_EXTENDED_PROFILES)) ||
|
||||||
(await this.doesServerSupportUnstableFeature(STABLE_MSC4133_EXTENDED_PROFILES))
|
(await this.doesServerSupportUnstableFeature(STABLE_MSC4133_EXTENDED_PROFILES))
|
||||||
);
|
);
|
||||||
@@ -6991,7 +6992,10 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
|
|||||||
* @returns The prefix for use with `authedRequest`
|
* @returns The prefix for use with `authedRequest`
|
||||||
*/
|
*/
|
||||||
private async getExtendedProfileRequestPrefix(): Promise<string> {
|
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 ClientPrefix.V3;
|
||||||
}
|
}
|
||||||
return "/_matrix/client/unstable/uk.tcpip.msc4133";
|
return "/_matrix/client/unstable/uk.tcpip.msc4133";
|
||||||
|
|||||||
@@ -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
|
* The timezone the user is currently in. The value of this property should
|
||||||
* match a timezone provided in https://www.iana.org/time-zones.
|
* 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
|
* @see https://github.com/matrix-org/matrix-spec-proposals/blob/clokep/profile-tz/proposals/4175-profile-field-time-zone.md
|
||||||
* @experimental
|
* @experimental
|
||||||
|
* @deprecated Unstable MSC field - Use `ProfileKeyTimezone`
|
||||||
*/
|
*/
|
||||||
export const ProfileKeyMSC4175Timezone = "us.cloke.msc4175.tz";
|
export const ProfileKeyMSC4175Timezone = "us.cloke.msc4175.tz";
|
||||||
|
|||||||
@@ -64,6 +64,10 @@ export interface Capabilities {
|
|||||||
"m.set_displayname"?: ISetDisplayNameCapability;
|
"m.set_displayname"?: ISetDisplayNameCapability;
|
||||||
"m.set_avatar_url"?: ISetAvatarUrlCapability;
|
"m.set_avatar_url"?: ISetAvatarUrlCapability;
|
||||||
"uk.tcpip.msc4133.profile_fields"?: IProfileFieldsCapability;
|
"uk.tcpip.msc4133.profile_fields"?: IProfileFieldsCapability;
|
||||||
|
/**
|
||||||
|
* Since Matrix v1.16
|
||||||
|
*/
|
||||||
|
"m.profile_fields"?: IProfileFieldsCapability;
|
||||||
}
|
}
|
||||||
|
|
||||||
type CapabilitiesResponse = {
|
type CapabilitiesResponse = {
|
||||||
|
|||||||
Reference in New Issue
Block a user