Make rooms in MemberInfo update when necessary
Factor out the chunk of code that looks through a read receipt event to see if it contain a read receipt from a given user, now we use it in 2 places.
This commit is contained in:
parent
590d6d3ee8
commit
6f2e0a4cdf
3 changed files with 94 additions and 8 deletions
|
@ -27,6 +27,7 @@ var sdk = require('../../../index');
|
|||
var rate_limited_func = require('../../../ratelimitedfunc');
|
||||
var Rooms = require('../../../Rooms');
|
||||
var DMRoomMap = require('../../../utils/DMRoomMap');
|
||||
var Receipt = require('../../../utils/Receipt');
|
||||
|
||||
var HIDE_CONFERENCE_CHANS = true;
|
||||
|
||||
|
@ -154,13 +155,8 @@ module.exports = React.createClass({
|
|||
onRoomReceipt: function(receiptEvent, room) {
|
||||
// because if we read a notification, it will affect notification count
|
||||
// only bother updating if there's a receipt from us
|
||||
var receiptKeys = Object.keys(receiptEvent.getContent());
|
||||
for (var i = 0; i < receiptKeys.length; ++i) {
|
||||
var rcpt = receiptEvent.getContent()[receiptKeys[i]];
|
||||
if (rcpt['m.read'] && rcpt['m.read'][MatrixClientPeg.get().credentials.userId]) {
|
||||
this._delayedRefreshRoomList();
|
||||
break;
|
||||
}
|
||||
if (Receipt.findReadReceiptFromUserId(receiptEvent, MatrixClientPeg.get().credentials.userId)) {
|
||||
this._delayedRefreshRoomList();
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue