From 6926c96f368b73f58fb3dad21f0d5be4aebd560c Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Sat, 14 Oct 2017 16:41:44 -0600 Subject: [PATCH] Hide pinning messages behind a labs settings Signed-off-by: Travis Ralston --- src/components/views/context_menus/MessageContextMenu.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/views/context_menus/MessageContextMenu.js b/src/components/views/context_menus/MessageContextMenu.js index 7085e81d5..a07d11626 100644 --- a/src/components/views/context_menus/MessageContextMenu.js +++ b/src/components/views/context_menus/MessageContextMenu.js @@ -64,7 +64,10 @@ module.exports = React.createClass({ const room = cli.getRoom(this.props.mxEvent.getRoomId()); const canRedact = room.currentState.maySendRedactionForEvent(this.props.mxEvent, cli.credentials.userId); - const canPin = room.currentState.mayClientSendStateEvent('m.room.pinned_events', cli); + let canPin = room.currentState.mayClientSendStateEvent('m.room.pinned_events', cli); + + // HACK: Intentionally say we can't pin if the user doesn't want to use the functionality + if (!UserSettingsStore.isFeatureEnabled("feature_pinning")) canPin = false; this.setState({canRedact, canPin}); },