Merge pull request #526 from matrix-org/dbkr/prevent_read_receipt_exception_logout

Don't send read receipt if user has logged out
pull/21833/head
Richard van der Hoff 2016-10-26 14:46:43 +01:00 committed by GitHub
commit b37ba90a38
1 changed files with 4 additions and 0 deletions

View File

@ -431,6 +431,10 @@ var TimelinePanel = React.createClass({
sendReadReceipt: function() {
if (!this.refs.messagePanel) return;
if (!this.props.manageReadReceipts) return;
// This happens on user_activity_end which is delayed, and it's
// very possible have logged out within that timeframe, so check
// we still have a client.
if (!MatrixClientPeg.get()) return;
// if we are scrolled to the bottom, do a quick-reset of our unreadNotificationCount
// to avoid having to wait from the remote echo from the homeserver.