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

Commit 4c79455

Browse files
authored
Merge branch 'develop' into unread-title-indicator
2 parents 73c2f42 + 54a6ce5 commit 4c79455

File tree

22 files changed

+293
-172
lines changed

22 files changed

+293
-172
lines changed

.eslintrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
module.exports = {
22
plugins: ["matrix-org"],
33
extends: ["plugin:matrix-org/babel", "plugin:matrix-org/react", "plugin:matrix-org/a11y"],
4+
parserOptions: {
5+
project: ["./tsconfig.json"],
6+
},
47
env: {
58
browser: true,
69
node: true,
@@ -168,6 +171,12 @@ module.exports = {
168171
"@typescript-eslint/explicit-member-accessibility": "off",
169172
},
170173
},
174+
{
175+
files: ["cypress/**/*.ts"],
176+
parserOptions: {
177+
project: ["./cypress/tsconfig.json"],
178+
},
179+
},
171180
],
172181
settings: {
173182
react: {

cypress/e2e/crypto/decryption-failure.spec.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ const handleVerificationRequest = (request: VerificationRequest): Chainable<Emoj
5252
verifier.on("show_sas", onShowSas);
5353
verifier.verify();
5454
}),
55+
// extra timeout, as this sometimes takes a while
56+
{ timeout: 30_000 },
5557
);
5658
};
5759

@@ -111,9 +113,8 @@ describe("Decryption Failure Bar", () => {
111113
})
112114
.then(() => {
113115
cy.botSendMessage(bot, roomId, "test");
114-
cy.wait(5000);
115-
cy.get(".mx_DecryptionFailureBar .mx_DecryptionFailureBar_message_headline").should(
116-
"have.text",
116+
cy.contains(
117+
".mx_DecryptionFailureBar .mx_DecryptionFailureBar_message_headline",
117118
"Verify this device to access all messages",
118119
);
119120

@@ -124,6 +125,7 @@ describe("Decryption Failure Bar", () => {
124125

125126
const verificationRequestPromise = waitForVerificationRequest(otherDevice);
126127
cy.get(".mx_CompleteSecurity_actionRow .mx_AccessibleButton").click();
128+
cy.contains("To proceed, please accept the verification request on your other device.");
127129
cy.wrap(verificationRequestPromise).then((verificationRequest: VerificationRequest) => {
128130
cy.wrap(verificationRequest.accept());
129131
handleVerificationRequest(verificationRequest).then((emojis) => {
@@ -170,9 +172,8 @@ describe("Decryption Failure Bar", () => {
170172
);
171173

172174
cy.botSendMessage(bot, roomId, "test");
173-
cy.wait(5000);
174-
cy.get(".mx_DecryptionFailureBar .mx_DecryptionFailureBar_message_headline").should(
175-
"have.text",
175+
cy.contains(
176+
".mx_DecryptionFailureBar .mx_DecryptionFailureBar_message_headline",
176177
"Reset your keys to prevent future decryption errors",
177178
);
178179

cypress/support/bot.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ function setupBotClient(
163163
}
164164
})
165165
.then(() => cli),
166+
// extra timeout, as this sometimes takes a while
167+
{ timeout: 30_000 },
166168
);
167169
});
168170
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@
190190
"eslint-plugin-deprecate": "^0.7.0",
191191
"eslint-plugin-import": "^2.25.4",
192192
"eslint-plugin-jsx-a11y": "^6.5.1",
193-
"eslint-plugin-matrix-org": "0.9.0",
193+
"eslint-plugin-matrix-org": "0.10.0",
194194
"eslint-plugin-react": "^7.28.0",
195195
"eslint-plugin-react-hooks": "^4.3.0",
196196
"eslint-plugin-unicorn": "^45.0.0",

res/css/views/dialogs/_AddExistingToSpaceDialog.pcss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ limitations under the License.
3838
}
3939

4040
.mx_AddExistingToSpace_section {
41+
margin-right: 12px; // provides space for scrollbar so that checkbox and scrollbar do not collide
42+
4143
&:not(:first-child) {
4244
margin-top: 24px;
4345
}

src/components/structures/PipContainer.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -258,17 +258,16 @@ class PipContainerInner extends React.Component<IProps, IState> {
258258
}
259259

260260
private createVoiceBroadcastPlaybackPipContent(voiceBroadcastPlayback: VoiceBroadcastPlayback): CreatePipChildren {
261-
if (this.state.viewedRoomId === voiceBroadcastPlayback.infoEvent.getRoomId()) {
262-
return ({ onStartMoving }) => (
263-
<div onMouseDown={onStartMoving}>
264-
<VoiceBroadcastPlaybackBody playback={voiceBroadcastPlayback} pip={true} />
265-
</div>
261+
const content =
262+
this.state.viewedRoomId === voiceBroadcastPlayback.infoEvent.getRoomId() ? (
263+
<VoiceBroadcastPlaybackBody playback={voiceBroadcastPlayback} pip={true} />
264+
) : (
265+
<VoiceBroadcastSmallPlaybackBody playback={voiceBroadcastPlayback} />
266266
);
267-
}
268267

269268
return ({ onStartMoving }) => (
270-
<div onMouseDown={onStartMoving}>
271-
<VoiceBroadcastSmallPlaybackBody playback={voiceBroadcastPlayback} />
269+
<div key={voiceBroadcastPlayback.infoEvent.getId()} onMouseDown={onStartMoving}>
270+
{content}
272271
</div>
273272
);
274273
}

src/components/views/dialogs/ServerOfflineDialog.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ export default class ServerOfflineDialog extends React.PureComponent<IProps> {
4848
private renderTimeline(): React.ReactElement[] {
4949
return EchoStore.instance.contexts.map((c, i) => {
5050
if (!c.firstFailedTime) return null; // not useful
51-
if (!(c instanceof RoomEchoContext)) throw new Error("Cannot render unknown context: " + c);
51+
if (!(c instanceof RoomEchoContext))
52+
throw new Error("Cannot render unknown context: " + c.constructor.name);
5253
const header = (
5354
<div className="mx_ServerOfflineDialog_content_context_timeline_header">
5455
<RoomAvatar width={24} height={24} room={c.room} />

src/components/views/elements/EventListSummary.tsx

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -507,39 +507,36 @@ export default class EventListSummary extends React.Component<IProps> {
507507
eventsToRender.forEach((e, index) => {
508508
const type = e.getType();
509509

510-
let userId = e.getSender();
511-
if (type === EventType.RoomMember) {
512-
userId = e.getStateKey();
510+
let userKey = e.getSender()!;
511+
if (type === EventType.RoomThirdPartyInvite) {
512+
userKey = e.getContent().display_name;
513+
} else if (type === EventType.RoomMember) {
514+
userKey = e.getStateKey();
513515
} else if (e.isRedacted()) {
514-
userId = e.getUnsigned()?.redacted_because?.sender;
516+
userKey = e.getUnsigned()?.redacted_because?.sender;
515517
}
516518

517519
// Initialise a user's events
518-
if (!userEvents[userId]) {
519-
userEvents[userId] = [];
520+
if (!userEvents[userKey]) {
521+
userEvents[userKey] = [];
520522
}
521523

522-
let displayName = userId;
523-
if (type === EventType.RoomThirdPartyInvite) {
524-
displayName = e.getContent().display_name;
525-
if (e.sender) {
526-
latestUserAvatarMember.set(userId, e.sender);
527-
}
528-
} else if (e.isRedacted()) {
529-
const sender = this.context?.room.getMember(userId);
524+
let displayName = userKey;
525+
if (e.isRedacted()) {
526+
const sender = this.context?.room?.getMember(userKey);
530527
if (sender) {
531528
displayName = sender.name;
532-
latestUserAvatarMember.set(userId, sender);
529+
latestUserAvatarMember.set(userKey, sender);
533530
}
534531
} else if (e.target && TARGET_AS_DISPLAY_NAME_EVENTS.includes(type as EventType)) {
535532
displayName = e.target.name;
536-
latestUserAvatarMember.set(userId, e.target);
537-
} else if (e.sender) {
533+
latestUserAvatarMember.set(userKey, e.target);
534+
} else if (e.sender && type !== EventType.RoomThirdPartyInvite) {
538535
displayName = e.sender.name;
539-
latestUserAvatarMember.set(userId, e.sender);
536+
latestUserAvatarMember.set(userKey, e.sender);
540537
}
541538

542-
userEvents[userId].push({
539+
userEvents[userKey].push({
543540
mxEvent: e,
544541
displayName,
545542
index: index,

src/components/views/rooms/RoomPreviewCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ const RoomPreviewCard: FC<IProps> = ({ room, onJoinButtonClicked, onRejectButton
116116
joinButtons = (
117117
<>
118118
<AccessibleButton
119-
kind="secondary"
119+
kind="primary_outline"
120120
onClick={() => {
121121
setBusy(true);
122122
onRejectButtonClicked();

src/components/views/settings/ProfileSettings.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@ export default class ProfileSettings extends React.Component<{}, IState> {
185185
withDisplayName: true,
186186
});
187187

188+
// False negative result from no-base-to-string rule, doesn't seem to account for Symbol.toStringTag
189+
// eslint-disable-next-line @typescript-eslint/no-base-to-string
190+
const avatarUrl = this.state.avatarUrl?.toString();
191+
188192
return (
189193
<form onSubmit={this.saveProfile} autoComplete="off" noValidate={true} className="mx_ProfileSettings">
190194
<input
@@ -216,7 +220,7 @@ export default class ProfileSettings extends React.Component<{}, IState> {
216220
</p>
217221
</div>
218222
<AvatarSetting
219-
avatarUrl={this.state.avatarUrl?.toString()}
223+
avatarUrl={avatarUrl}
220224
avatarName={this.state.displayName || this.state.userId}
221225
avatarAltText={_t("Profile picture")}
222226
uploadAvatar={this.uploadAvatar}

0 commit comments

Comments
 (0)