You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-08-07 21:23:00 +03:00
Read receipts for threads (#9239)
* Use EventType enum instead of hardcoded value * Enable read receipts on thread timelines * Strict null checks * Strict null checks * fix import group * strict checks * strict checks * null check * fix tests
This commit is contained in:
@@ -42,7 +42,7 @@ const newReceipt = (eventId: string, userId: string, readTs: number, fullyReadTs
|
||||
[ReceiptType.FullyRead]: { [userId]: { ts: fullyReadTs } },
|
||||
},
|
||||
};
|
||||
return new MatrixEvent({ content: receiptContent, type: "m.receipt" });
|
||||
return new MatrixEvent({ content: receiptContent, type: EventType.Receipt });
|
||||
};
|
||||
|
||||
const renderPanel = (room: Room, events: MatrixEvent[]): RenderResult => {
|
||||
@@ -154,7 +154,7 @@ describe('TimelinePanel', () => {
|
||||
});
|
||||
|
||||
renderPanel(room, events);
|
||||
expect(client.setRoomReadMarkers).toHaveBeenCalledWith(room.roomId, null, events[0], events[0]);
|
||||
expect(client.setRoomReadMarkers).toHaveBeenCalledWith(room.roomId, "", events[0], events[0]);
|
||||
});
|
||||
|
||||
it("does not send public read receipt when enabled", () => {
|
||||
@@ -169,7 +169,7 @@ describe('TimelinePanel', () => {
|
||||
});
|
||||
|
||||
renderPanel(room, events);
|
||||
expect(client.setRoomReadMarkers).toHaveBeenCalledWith(room.roomId, null, null, events[0]);
|
||||
expect(client.setRoomReadMarkers).toHaveBeenCalledWith(room.roomId, "", undefined, events[0]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user