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 = {_t('Unpin; + } + return (
Jump to message - {_t('Unpin + { unpinButton }
diff --git a/src/skins/vector/css/vector-web/views/rooms/_PinnedEventsPanel.scss b/src/skins/vector/css/vector-web/views/rooms/_PinnedEventsPanel.scss index a2041cfe4..44297cfae 100644 --- a/src/skins/vector/css/vector-web/views/rooms/_PinnedEventsPanel.scss +++ b/src/skins/vector/css/vector-web/views/rooms/_PinnedEventsPanel.scss @@ -20,7 +20,8 @@ limitations under the License. .mx_PinnedEventsPanel_body { max-height: 300px; - overflow-y: scroll; + overflow-y: auto; + padding-bottom: 15px; } .mx_PinnedEventsPanel_header {