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

Commit 3d07473

Browse files
committed
Strict fixes.
1 parent b805ecb commit 3d07473

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Diff for: src/components/views/rooms/EditMessageComposer.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export function attachDifferentialMentions(sender: string, editedContent: IConte
8585
const prevMentions = editedContent["org.matrix.msc3952.mentions"];
8686
const prevUserMentions = new Set();
8787
if (Array.isArray(prevMentions?.user_ids)) {
88-
prevMentions.user_ids.forEach((userId) => prevUserMentions.add(userId));
88+
prevMentions!.user_ids.forEach((userId) => prevUserMentions.add(userId));
8989
}
9090

9191
// Generate the differential mentions: users who were not previously mentioned
@@ -150,8 +150,8 @@ export function createEditContent(model: EditorModel, editedEvent: MatrixEvent):
150150
// Build the mentions property for the *new* content (as if there was no edit).
151151
//
152152
// TODO If this is a reply we need to include all the users from it.
153-
attachMentions(editedEvent.sender.userId, newContent, model, undefined);
154-
const mentions = attachDifferentialMentions(editedEvent.sender.userId, editedEvent.getContent(), model);
153+
attachMentions(editedEvent.sender!.userId, newContent, model, undefined);
154+
const mentions = attachDifferentialMentions(editedEvent.sender!.userId, editedEvent.getContent(), model);
155155

156156
return Object.assign(
157157
{

Diff for: src/components/views/rooms/SendMessageComposer.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export function attachMentions(
8686
// If there's a reply, initialize the mentioned users as the sender of that
8787
// event + any mentioned users in that event.
8888
if (replyToEvent) {
89-
userMentions.add(replyToEvent.sender.userId);
89+
userMentions.add(replyToEvent.sender!.userId);
9090
// TODO What do we do if the prely event *doeesn't* have this property?
9191
// Try to fish out replies from the contents?
9292
const userIds = replyToEvent.getContent()["org.matrix.msc3952.mentions"]?.user_ids;
@@ -471,7 +471,7 @@ export class SendMessageComposer extends React.Component<ISendMessageComposerPro
471471
const { roomId } = this.props.room;
472472
if (!content) {
473473
content = createMessageContent(
474-
this.props.mxClient.getUserId(),
474+
this.props.mxClient.getUserId()!,
475475
model,
476476
replyToEvent,
477477
this.props.relation,

0 commit comments

Comments
 (0)