Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge branch 'develop' into search-paste
Browse files Browse the repository at this point in the history
  • Loading branch information
peterscheu-aceart committed Jul 28, 2023
2 parents c235472 + 0647aaf commit 35a4194
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 34 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/static_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ jobs:

# Temporary while we directly import matrix-js-sdk/src/* which means we need
# certain @types/* packages to make sense of matrix-js-sdk types.
- name: Typecheck (release mode; no yarn link)
if: github.event_name != 'pull_request'
run: |
yarn unlink matrix-js-sdk
yarn install --force
yarn run lint:types
#- name: Typecheck (release mode; no yarn link)
# if: github.event_name != 'pull_request'
# run: |
# yarn unlink matrix-js-sdk
# yarn install --force
# yarn run lint:types

i18n_lint:
name: "i18n Check"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
},
"dependencies": {
"@babel/runtime": "^7.12.5",
"@matrix-org/matrix-wysiwyg": "^2.4.1",
"@matrix-org/analytics-events": "^0.6.0",
"@matrix-org/matrix-wysiwyg": "^2.3.1",
"@matrix-org/react-sdk-module-api": "^1.0.0",
"@sentry/browser": "^7.0.0",
"@sentry/tracing": "^7.0.0",
Expand Down
5 changes: 0 additions & 5 deletions res/css/views/rooms/_EventTile.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -1203,11 +1203,6 @@ $left-gutter: 64px;
height: 14px; /* avatar img size */
}

.mx_ViewSourceEvent_toggle {
display: none; /* hide the hidden event expand button, not enough
space, view source can still be used */
}

&.mx_EventTile_selected .mx_EventTile_line,
.mx_EventTile_line {
$line-height: $font-12px;
Expand Down
3 changes: 2 additions & 1 deletion src/components/views/auth/RegistrationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,8 @@ export default class RegistrationForm extends React.PureComponent<IProps, IState
}

private showEmail(): boolean {
if (!this.authStepIsUsed("m.login.email.identity")) {
const threePidLogin = !SdkConfig.get().disable_3pid_login;
if (!threePidLogin || !this.authStepIsUsed("m.login.email.identity")) {
return false;
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/rooms/MessageComposer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ export class MessageComposer extends React.Component<IProps, IState> {

const { isRichTextEnabled, composerContent } = this.state;
const convertedContent = isRichTextEnabled
? await richToPlain(composerContent)
? await richToPlain(composerContent, false)
: await plainToRich(composerContent, false);

this.setState({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ export const dynamicImportConversionFunctions = async (): Promise<{
* ensure that HTML entities are correctly interpreted, and to prevent newline characters being turned into `<br>`.
*
* @param rich - html to convert
* @param inMessageFormat - `true` to format the return value for use as a message `formatted_body`.
* `false` to format it for writing to an editor element.
* @returns a string of plain text that may contain markdown
*/
richToPlain(rich: string): Promise<string>;
richToPlain(rich: string, inMessageFormat: boolean): Promise<string>;

/**
* Creates a rust model from plain text input (interpreted as markdown) and uses it to generate the rich text
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export async function createMessageContent(

// if we're editing rich text, the message content is pure html
// BUT if we're not, the message content will be plain text where we need to convert the mentions
const body = isHTML ? await richToPlain(message) : convertPlainTextToBody(message);
const body = isHTML ? await richToPlain(message, false) : convertPlainTextToBody(message);
const bodyPrefix = (isReplyAndEditing && getTextReplyFallback(editedEvent)) || "";
const formattedBodyPrefix = (isReplyAndEditing && getHtmlReplyFallback(editedEvent)) || "";

Expand Down
2 changes: 1 addition & 1 deletion src/components/views/settings/SecureBackupPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export default class SecureBackupPanel extends React.PureComponent<{}, IState> {

private async getUpdatedDiagnostics(): Promise<void> {
const cli = MatrixClientPeg.safeGet();
const crypto = cli.crypto;
const crypto = cli.getCrypto();
if (!crypto) return;

const secretStorage = cli.secretStorage;
Expand Down
16 changes: 7 additions & 9 deletions test/components/views/settings/SecureBackupPanel-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ import React from "react";
import { fireEvent, render, screen, within } from "@testing-library/react";
import { mocked } from "jest-mock";

import { flushPromises, getMockClientWithEventEmitter, mockClientMethodsUser } from "../../../test-utils";
import {
flushPromises,
getMockClientWithEventEmitter,
mockClientMethodsCrypto,
mockClientMethodsUser,
} from "../../../test-utils";
import SecureBackupPanel from "../../../../src/components/views/settings/SecureBackupPanel";
import { accessSecretStorage } from "../../../../src/SecurityManager";

Expand All @@ -30,20 +35,13 @@ describe("<SecureBackupPanel />", () => {
const userId = "@alice:server.org";
const client = getMockClientWithEventEmitter({
...mockClientMethodsUser(userId),
checkKeyBackup: jest.fn(),
isKeyBackupKeyStored: jest.fn(),
...mockClientMethodsCrypto(),
getKeyBackupEnabled: jest.fn(),
getKeyBackupVersion: jest.fn().mockReturnValue("1"),
isKeyBackupTrusted: jest.fn().mockResolvedValue(true),
getClientWellKnown: jest.fn(),
deleteKeyBackupVersion: jest.fn(),
secretStorage: { hasKey: jest.fn() },
});
// @ts-ignore allow it
client.crypto = {
getSessionBackupPrivateKey: jest.fn(),
isSecretStorageReady: jest.fn(),
} as unknown as Crypto;

const getComponent = () => render(<SecureBackupPanel />);

Expand Down
6 changes: 2 additions & 4 deletions test/test-utils/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,6 @@ export const mockClientMethodsCrypto = (): Partial<
getStoredCrossSigningForUser: jest.fn(),
checkKeyBackup: jest.fn().mockReturnValue({}),
secretStorage: { hasKey: jest.fn() },
crypto: {
isSecretStorageReady: jest.fn(),
getSessionBackupPrivateKey: jest.fn(),
},
getCrypto: jest.fn().mockReturnValue({
getUserDeviceInfo: jest.fn(),
getCrossSigningStatus: jest.fn().mockResolvedValue({
Expand All @@ -171,5 +167,7 @@ export const mockClientMethodsCrypto = (): Partial<
},
}),
isCrossSigningReady: jest.fn().mockResolvedValue(true),
isSecretStorageReady: jest.fn(),
getSessionBackupPrivateKey: jest.fn(),
}),
});
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1806,10 +1806,10 @@
resolved "https://registry.yarnpkg.com/@matrix-org/matrix-sdk-crypto-wasm/-/matrix-sdk-crypto-wasm-1.0.1.tgz#21a0557a7bb3f60b37c6d412be8906c056fe79b8"
integrity sha512-VTwV5IowvhhLXwAsDDAv02bC5/qBQbG2YtpYAije11253sQ3MePIoSR+dS40Ih3lAlEzqQ00GU3O+i45jMzIRQ==

"@matrix-org/matrix-wysiwyg@^2.3.1":
version "2.3.1"
resolved "https://registry.yarnpkg.com/@matrix-org/matrix-wysiwyg/-/matrix-wysiwyg-2.3.1.tgz#4b607323f3ffd8c332abeba7226010ecc031ed12"
integrity sha512-OxJvA+pSGdP2f55foZGEDmU2qvILFLLjV53MOgPw1F6zDAp8nDL1rPPIzFv1qgDj5W7d4Rzq7FnN25vINnAu+A==
"@matrix-org/matrix-wysiwyg@^2.4.1":
version "2.4.1"
resolved "https://registry.yarnpkg.com/@matrix-org/matrix-wysiwyg/-/matrix-wysiwyg-2.4.1.tgz#e1325a42366a1c891b2ba90c88e597b39187b2cb"
integrity sha512-RyUijZXVKenE9s3LczDUhWFeOfIyLcsOrAyHqYxnizXX5nxMkHxTgLeoTvaIJ+1dOhI+H2SS9G4VcN6odZ0aNg==

"@matrix-org/olm@https://gitlab.matrix.org/api/v4/projects/27/packages/npm/@matrix-org/olm/-/@matrix-org/olm-3.2.14.tgz":
version "3.2.14"
Expand Down

0 comments on commit 35a4194

Please sign in to comment.