diff --git a/src/components/views/rooms/PinnedEventsPanel.js b/src/components/views/rooms/PinnedEventsPanel.js index 53bf3db65..8f898b11e 100644 --- a/src/components/views/rooms/PinnedEventsPanel.js +++ b/src/components/views/rooms/PinnedEventsPanel.js @@ -55,6 +55,9 @@ const PinnedEventTile = React.createClass({ } else if (this.props.onUnpinned) this.props.onUnpinned(); } }, + _canUnpin: function() { + return this.props.mxRoom.currentState.mayClientSendStateEvent('m.room.pinned_events', MatrixClientPeg.get()); + }, render: function() { const MessageEvent = sdk.getComponent("views.messages.MessageEvent"); const MemberAvatar = sdk.getComponent("views.avatars.MemberAvatar"); @@ -62,14 +65,19 @@ const PinnedEventTile = React.createClass({ const sender = this.props.mxRoom.getMember(this.props.mxEvent.getSender()); const avatarSize = 40; + let unpinButton = null; + if (this._canUnpin()) { + unpinButton = ; + } + return (