1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-09-01 21:21:58 +03:00

Revert c13b180 as it fails lint (creating functions in a loop)

This commit is contained in:
David Baker
2015-11-09 13:48:05 +00:00
parent c13b1800b9
commit ad24596d3f

View File

@@ -375,13 +375,15 @@ Room.prototype.recalculate = function(userId) {
var readReceiptsForEvent = this.getReceiptsForEvent(e); var readReceiptsForEvent = this.getReceiptsForEvent(e);
readReceiptsForEvent.forEach(function(receipt) { for (var receiptIt = 0; receiptIt < readReceiptsForEvent.length; ++receiptIt) {
if (receipt.type !== "m.read") { return; } var receipt = readReceiptsForEvent[receiptIt];
if (usersFound[receipt.userId]) { return; } if (receipt.type !== "m.read") { continue; }
if (usersFound[receipt.userId]) { continue; }
// Then this is the receipt we keep for this user // Then this is the receipt we keep for this user
usersFound[receipt.userId] = 1; usersFound[receipt.userId] = 1;
}); }
if (e.sender && usersFound[e.sender.userId] === undefined) { if (e.sender && usersFound[e.sender.userId] === undefined) {
// no receipt yet for this sender, so we synthesize one. // no receipt yet for this sender, so we synthesize one.