You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-08-09 10:22:46 +03:00
forEach probably nicer here
This commit is contained in:
@@ -375,15 +375,13 @@ Room.prototype.recalculate = function(userId) {
|
||||
|
||||
var readReceiptsForEvent = this.getReceiptsForEvent(e);
|
||||
|
||||
for (var receiptIt = 0; receiptIt < readReceiptsForEvent.length; ++receiptIt) {
|
||||
var receipt = readReceiptsForEvent[receiptIt];
|
||||
if (receipt.type !== "m.read") { continue; }
|
||||
|
||||
if (usersFound[receipt.userId]) { continue; }
|
||||
readReceiptsForEvent.forEach(function(receipt) {
|
||||
if (receipt.type !== "m.read") { return; }
|
||||
if (usersFound[receipt.userId]) { return; }
|
||||
|
||||
// Then this is the receipt we keep for this user
|
||||
usersFound[receipt.userId] = 1;
|
||||
}
|
||||
});
|
||||
|
||||
if (e.sender && usersFound[e.sender.userId] === undefined) {
|
||||
// no receipt yet for this sender, so we synthesize one.
|
||||
|
Reference in New Issue
Block a user