You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-12-23 22:42:10 +03:00
Add event to get last read receipt for a user.
This commit is contained in:
@@ -321,6 +321,21 @@ Room.prototype.getUsersReadUpTo = function(event) {
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the ID of the event that a given user has read up to, or null if we
|
||||
* have received no read receipts from them.
|
||||
* @param {String} user ID to get read receipt event ID for
|
||||
* @return {String} ID of the latest event that the given user has read, or null.
|
||||
* an empty list.
|
||||
*/
|
||||
Room.prototype.getEventReadUpTo = function(userId) {
|
||||
if (this._receipts === undefined || this._receipts['m.read'] === undefined) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return this._receipts['m.read'][userId].eventId;
|
||||
};
|
||||
|
||||
/**
|
||||
* Get a list of receipts for the given event.
|
||||
* @param {MatrixEvent} event the event to get receipts for
|
||||
|
||||
Reference in New Issue
Block a user