-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmatrix-js-sdk+25.0.0.patch
40 lines (35 loc) · 1.58 KB
/
matrix-js-sdk+25.0.0.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
diff --git a/node_modules/matrix-js-sdk/src/client.ts b/node_modules/matrix-js-sdk/src/client.ts
index cb8df7a..1ca2f21 100644
--- a/node_modules/matrix-js-sdk/src/client.ts
+++ b/node_modules/matrix-js-sdk/src/client.ts
@@ -20,6 +20,7 @@ limitations under the License.
import { Optional } from "matrix-events-sdk";
+
import type { IDeviceKeys, IMegolmSessionData, IOneTimeKey } from "./@types/crypto";
import { ISyncStateData, SyncApi, SyncApiOptions, SyncState } from "./sync";
import {
@@ -214,6 +215,9 @@ import {
ServerSideSecretStorageImpl,
} from "./secret-storage";
+import TchapUIFeature from '../../../src/util/TchapUIFeature'; // :TCHAP:
+
+
export type Store = IStore;
export type ResetTimelineCallback = (roomId: string) => boolean;
@@ -7284,6 +7288,17 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
const response = await this.getVersions();
if (!response) return false;
const unstableFeatures = response["unstable_features"];
+
+ // :TCHAP: disable cross signing if needed, by pretending the server doesn't support it.
+ console.log('TCHAP server versions', response);
+ if (!TchapUIFeature.isCrossSigningAndSecureStorageActive()) {
+ unstableFeatures["org.matrix.e2e_cross_signing"] = false;
+ }
+ if (feature === "org.matrix.e2e_cross_signing") {
+ console.info(':TCHAP: doesServerSupportUnstableFeature org.matrix.e2e_cross_signing', unstableFeatures);
+ }
+ // end :TCHAP:
+
return unstableFeatures && !!unstableFeatures[feature];
}