diff --git a/src/components/views/rooms/MemberInfo.js b/src/components/views/rooms/MemberInfo.js
index 64eeddb406..b9324249e9 100644
--- a/src/components/views/rooms/MemberInfo.js
+++ b/src/components/views/rooms/MemberInfo.js
@@ -62,6 +62,7 @@ module.exports = withMatrixClient(React.createClass({
updating: 0,
devicesLoading: true,
devices: null,
+ isIgnoring: false,
};
},
@@ -81,6 +82,8 @@ module.exports = withMatrixClient(React.createClass({
cli.on("RoomState.events", this.onRoomStateEvents);
cli.on("RoomMember.name", this.onRoomMemberName);
cli.on("accountData", this.onAccountData);
+
+ this._checkIgnoreState();
},
componentDidMount: function() {
@@ -111,6 +114,11 @@ module.exports = withMatrixClient(React.createClass({
}
},
+ _checkIgnoreState: function() {
+ const isIgnoring = this.props.matrixClient.getIgnoredUsers().indexOf(this.props.member.userId) !== -1;
+ this.setState({isIgnoring: isIgnoring});
+ },
+
_disambiguateDevices: function(devices) {
var names = Object.create(null);
for (var i = 0; i < devices.length; i++) {
@@ -225,6 +233,18 @@ module.exports = withMatrixClient(React.createClass({
});
},
+ onIgnoreToggle: function() {
+ const ignoredUsers = this.props.matrixClient.getIgnoredUsers();
+ if (this.state.isIgnoring) {
+ const index = ignoredUsers.indexOf(this.props.member.userId);
+ if (index !== -1) ignoredUsers.splice(index, 1);
+ } else {
+ ignoredUsers.push(this.props.member.userId);
+ }
+
+ this.props.matrixClient.setIgnoredUsers(ignoredUsers).then(() => this.setState({isIgnoring: !this.state.isIgnoring}));
+ },
+
onKick: function() {
const membership = this.props.member.membership;
const kickLabel = membership === "invite" ? _t("Disinvite") : _t("Kick");
@@ -607,6 +627,29 @@ module.exports = withMatrixClient(React.createClass({
);
},
+ _renderUserOptions: function() {
+ // Only allow the user to ignore the user if its not ourselves
+ let ignoreButton = null;
+ if (this.props.member.userId !== this.props.matrixClient.getUserId()) {
+ ignoreButton = (
+