From 315f7a3ae7917d4bf0ebe32ce286cc17937e6b2c Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 28 Aug 2017 13:46:09 +0100 Subject: [PATCH] apply shouldHideEvent fn to onRoomTimeline for RoomStatusBar prevents N new message(s) when a hidden message comes in. --- src/components/structures/RoomView.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index f825d1efbb..d9fc7a4e9a 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -20,6 +20,8 @@ limitations under the License. // - Drag and drop // - File uploading - uploadFile() +import shouldHideEvent from "../../shouldHideEvent"; + var React = require("react"); var ReactDOM = require("react-dom"); import Promise from 'bluebird'; @@ -143,6 +145,8 @@ module.exports = React.createClass({ MatrixClientPeg.get().on("RoomMember.membership", this.onRoomMemberMembership); MatrixClientPeg.get().on("accountData", this.onAccountData); + this._syncedSettings = UserSettingsStore.getSyncedSettings(); + // Start listening for RoomViewStore updates this._roomStoreToken = RoomViewStore.addListener(this._onRoomViewStoreUpdate); this._onRoomViewStoreUpdate(true); @@ -497,8 +501,7 @@ module.exports = React.createClass({ // update unread count when scrolled up if (!this.state.searchResults && this.state.atEndOfLiveTimeline) { // no change - } - else { + } else if (!shouldHideEvent(ev, this._syncedSettings)) { this.setState((state, props) => { return {numUnreadMessages: state.numUnreadMessages + 1}; });