mirror of https://github.com/vector-im/riot-web
Hide read receipts and typing notifs for ignored users
Signed-off-by: Travis Ralston <travpc@gmail.com>pull/21833/head
parent
2e72d6cd7c
commit
6e00f70320
|
@ -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]
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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),
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue