Hide read receipts and typing notifs for ignored users

Signed-off-by: Travis Ralston <travpc@gmail.com>
pull/21833/head
turt2live 2017-09-14 20:25:02 -06:00
parent 2e72d6cd7c
commit 6e00f70320
3 changed files with 10 additions and 1 deletions

View File

@ -18,6 +18,12 @@ var MatrixClientPeg = require("./MatrixClientPeg");
import { _t } from './languageHandler'; import { _t } from './languageHandler';
module.exports = { module.exports = {
usersTypingApartFromMeAndIgnored: function(room) {
return this.usersTyping(
room, [MatrixClientPeg.get().credentials.userId].concat(MatrixClientPeg.get().getIgnoredUsers())
);
},
usersTypingApartFromMe: function(room) { usersTypingApartFromMe: function(room) {
return this.usersTyping( return this.usersTyping(
room, [MatrixClientPeg.get().credentials.userId] room, [MatrixClientPeg.get().credentials.userId]

View File

@ -553,6 +553,9 @@ module.exports = React.createClass({
if (!r.userId || r.type !== "m.read" || r.userId === myUserId) { if (!r.userId || r.type !== "m.read" || r.userId === myUserId) {
return; // ignore non-read receipts and receipts from self. return; // ignore non-read receipts and receipts from self.
} }
if (MatrixClientPeg.get().isUserIgnored(r.userId)) {
return; // ignore ignored users
}
let member = room.getMember(r.userId); let member = room.getMember(r.userId);
if (!member) { if (!member) {
return; // ignore unknown user IDs return; // ignore unknown user IDs

View File

@ -121,7 +121,7 @@ module.exports = React.createClass({
onRoomMemberTyping: function(ev, member) { onRoomMemberTyping: function(ev, member) {
this.setState({ this.setState({
usersTyping: WhoIsTyping.usersTypingApartFromMe(this.props.room), usersTyping: WhoIsTyping.usersTypingApartFromMeAndIgnored(this.props.room),
}); });
}, },