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:
parent
fa2ec7f6c9
commit
71cf9bf932
7 changed files with 87 additions and 66 deletions
|
@ -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]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue