Skip to content

Commit

Permalink
refactor: rename variable for isDeleted helper
Browse files Browse the repository at this point in the history
  • Loading branch information
domw30 committed Oct 13, 2023
1 parent 666961a commit a7188b5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/chat/matrix-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ export class MatrixClient implements IChatClient {
return dmConversationIds.includes(room.roomId) || !!room.getDMInviter();
};

private isDeleted(m) {
return m?.unsigned?.redacted_because;
private isDeleted(event) {
return event?.unsigned?.redacted_because;
}

async searchMyNetworksByName(filter: string): Promise<MemberNetworks[]> {
Expand All @@ -142,7 +142,7 @@ export class MatrixClient implements IChatClient {
async getMessagesByChannelId(channelId: string, _lastCreatedAt?: number): Promise<MessagesResponse> {
await this.waitForConnection();
const { chunk } = await this.matrix.createMessagesRequest(channelId, null, 50, Direction.Backward);
const messages = chunk.filter((m) => m.type === EventType.RoomMessage && !this.isDeleted(m));
const messages = chunk.filter((event) => event.type === EventType.RoomMessage && !this.isDeleted(event));
const mappedMessages = [];
for (const message of messages) {
mappedMessages.push(mapMatrixMessage(message, this.matrix));
Expand Down

0 comments on commit a7188b5

Please sign in to comment.