From f2649f7807cd65b787a03e0a78a3f2b77af22987 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 12 Dec 2018 23:07:03 -0700 Subject: [PATCH] Use the now-prefixed js-sdk status message API See https://github.com/matrix-org/matrix-js-sdk/commit/08b3dfa3b5b5d0b63272f0b80b9fdd88d0795c45 --- src/components/views/avatars/MemberStatusMessageAvatar.js | 6 +++--- .../views/context_menus/StatusMessageContextMenu.js | 6 +++--- src/components/views/rooms/MemberInfo.js | 2 +- src/components/views/rooms/MemberTile.js | 2 +- src/components/views/rooms/RoomTile.js | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/components/views/avatars/MemberStatusMessageAvatar.js b/src/components/views/avatars/MemberStatusMessageAvatar.js index 00b25b3c73..2a2c97ee7c 100644 --- a/src/components/views/avatars/MemberStatusMessageAvatar.js +++ b/src/components/views/avatars/MemberStatusMessageAvatar.js @@ -40,7 +40,7 @@ export default class MemberStatusMessageAvatar extends React.Component { MatrixClientPeg.get().on("RoomState.events", this._onRoomStateEvents); if (this.props.member.user) { - this.setState({message: this.props.member.user.statusMessage}); + this.setState({message: this.props.member.user._unstable_statusMessage}); } else { this.setState({message: ""}); } @@ -55,7 +55,7 @@ export default class MemberStatusMessageAvatar extends React.Component { _onRoomStateEvents(ev, state) { if (ev.getStateKey() !== MatrixClientPeg.get().getUserId()) return; if (ev.getType() !== "im.vector.user_status") return; - // TODO: We should be relying on `this.props.member.user.statusMessage` + // TODO: We should be relying on `this.props.member.user._unstable_statusMessage` this.setState({message: ev.getContent()["status"]}); this.forceUpdate(); } @@ -82,7 +82,7 @@ export default class MemberStatusMessageAvatar extends React.Component { } render() { - const hasStatus = this.props.member.user ? !!this.props.member.user.statusMessage : false; + const hasStatus = this.props.member.user ? !!this.props.member.user._unstable_statusMessage : false; const classes = classNames({ "mx_MemberStatusMessageAvatar": true, diff --git a/src/components/views/context_menus/StatusMessageContextMenu.js b/src/components/views/context_menus/StatusMessageContextMenu.js index f77669329f..a3b31420f6 100644 --- a/src/components/views/context_menus/StatusMessageContextMenu.js +++ b/src/components/views/context_menus/StatusMessageContextMenu.js @@ -29,18 +29,18 @@ export default class StatusMessageContextMenu extends React.Component { this._onStatusChange = this._onStatusChange.bind(this); this.state = { - message: props.user ? props.user.statusMessage : "", + message: props.user ? props.user._unstable_statusMessage : "", }; } async _onClearClick(e) { - await MatrixClientPeg.get().setStatusMessage(""); + await MatrixClientPeg.get()._unstable_setStatusMessage(""); this.setState({message: ""}); } _onSubmit(e) { e.preventDefault(); - MatrixClientPeg.get().setStatusMessage(this.state.message); + MatrixClientPeg.get()._unstable_setStatusMessage(this.state.message); } _onStatusChange(e) { diff --git a/src/components/views/rooms/MemberInfo.js b/src/components/views/rooms/MemberInfo.js index 4eea33e952..6bcdc53d4c 100644 --- a/src/components/views/rooms/MemberInfo.js +++ b/src/components/views/rooms/MemberInfo.js @@ -895,7 +895,7 @@ module.exports = withMatrixClient(React.createClass({ presenceState = this.props.member.user.presence; presenceLastActiveAgo = this.props.member.user.lastActiveAgo; presenceCurrentlyActive = this.props.member.user.currentlyActive; - statusMessage = this.props.member.user.statusMessage; + statusMessage = this.props.member.user._unstable_statusMessage; } const room = this.props.matrixClient.getRoom(this.props.member.roomId); diff --git a/src/components/views/rooms/MemberTile.js b/src/components/views/rooms/MemberTile.js index d246b37234..96a8e0b515 100644 --- a/src/components/views/rooms/MemberTile.js +++ b/src/components/views/rooms/MemberTile.js @@ -84,7 +84,7 @@ module.exports = React.createClass({ const name = this._getDisplayName(); const active = -1; const presenceState = member.user ? member.user.presence : null; - const statusMessage = member.user ? member.user.statusMessage : null; + const statusMessage = member.user ? member.user._unstable_statusMessage : null; const av = ( diff --git a/src/components/views/rooms/RoomTile.js b/src/components/views/rooms/RoomTile.js index fa18a0687b..91c5d0321d 100644 --- a/src/components/views/rooms/RoomTile.js +++ b/src/components/views/rooms/RoomTile.js @@ -257,8 +257,8 @@ module.exports = React.createClass({ if (!isInvite && isJoined && looksLikeDm) { const selfId = MatrixClientPeg.get().getUserId(); const otherMember = this.props.room.currentState.getMembersExcept([selfId])[0]; - if (otherMember.user && otherMember.user.statusMessage) { - subtext = otherMember.user.statusMessage; + if (otherMember.user && otherMember.user._unstable_statusMessage) { + subtext = otherMember.user._unstable_statusMessage; } }