You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-09-01 21:21:58 +03:00
Emit events for read receipts
This commit is contained in:
@@ -399,6 +399,10 @@ Room.prototype.addReceipt = function(event) {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// send events after we've regenerated the cache, otherwise things that
|
||||
// listened for the event would read from a stale cache
|
||||
this.emit("Room.receipt", event, this);
|
||||
};
|
||||
|
||||
function setEventMetadata(event, stateContext, toStartOfTimeline) {
|
||||
@@ -527,3 +531,14 @@ module.exports = Room;
|
||||
* var newName = room.name;
|
||||
* });
|
||||
*/
|
||||
|
||||
/**
|
||||
* Fires whenever a receipt is received for a room
|
||||
* @event module:client~MatrixClient#"Room.receipt"
|
||||
* @param {event} event The receipt event
|
||||
* @param {Room} room The room whose Room.name was updated.
|
||||
* @example
|
||||
* matrixClient.on("Room.receipt", function(event, room){
|
||||
* var receiptContent = event.getContent();
|
||||
* });
|
||||
*/
|
||||
|
Reference in New Issue
Block a user