diff --git a/src/message/messageActionSheet.js b/src/message/messageActionSheet.js index 3d571248faf..7fd9f8ff679 100644 --- a/src/message/messageActionSheet.js +++ b/src/message/messageActionSheet.js @@ -52,12 +52,6 @@ const reply = ({ message, dispatch, ownEmail }) => { reply.title = 'Reply'; reply.errorMessage = 'Failed to reply'; -const narrowToTopic = ({ message, dispatch, ownEmail }) => { - dispatch(doNarrow(getNarrowFromMessage(message, ownEmail), message.id)); -}; -narrowToTopic.title = 'Narrow to topic'; -narrowToTopic.errorMessage = 'Failed to narrow to topic'; - const copyToClipboard = async ({ _, auth, message }) => { const rawMessage = isAnOutboxMessage(message) /* $FlowFixMe: then really type Outbox */ ? message.markdownContent @@ -154,7 +148,6 @@ const allButtonsRaw = { // For messages addReaction, reply, - narrowToTopic, copyToClipboard, shareMessage, editMessage, @@ -185,7 +178,6 @@ type ConstructSheetParams = {| backgroundData: BackgroundData, message: Message | Outbox, narrow: Narrow, - isAnnouncementOnly: boolean, |}; export const constructHeaderActionButtons = ({ @@ -214,10 +206,9 @@ const messageNotDeleted = (message: Message | Outbox): boolean => message.content !== '

(deleted)

'; export const constructMessageActionButtons = ({ - backgroundData: { ownEmail, flags, isAdmin }, + backgroundData: { ownEmail, flags }, message, narrow, - isAnnouncementOnly, }: ConstructSheetParams): ButtonCode[] => { const buttons = []; if (message.reactions.length > 0) { @@ -227,11 +218,7 @@ export const constructMessageActionButtons = ({ buttons.push('addReaction'); } if (!isAnOutboxMessage(message) && !isTopicNarrow(narrow) && !isPrivateOrGroupNarrow(narrow)) { - if (isAnnouncementOnly && !isAdmin) { - buttons.push('narrowToTopic'); - } else { - buttons.push('reply'); - } + buttons.push('reply'); } if (messageNotDeleted(message)) { buttons.push('copyToClipboard'); diff --git a/src/webview/MessageList.js b/src/webview/MessageList.js index 0b9e8088769..4852ad306ca 100644 --- a/src/webview/MessageList.js +++ b/src/webview/MessageList.js @@ -54,7 +54,6 @@ import { getUpdateEvents } from './webViewHandleUpdates'; import { handleMessageListEvent } from './webViewEventHandlers'; import { base64Utf8Encode } from '../utils/encoding'; import * as logging from '../utils/logging'; -import { getIsActiveStreamAnnouncementOnly } from '../subscriptions/subscriptionSelectors'; // ESLint doesn't notice how `this.props` escapes, and complains about some // props not being used here. @@ -74,7 +73,6 @@ export type BackgroundData = $ReadOnly<{ mute: MuteState, ownEmail: string, ownUserId: number, - isAdmin: boolean, allImageEmojiById: $ReadOnly<{ [id: string]: ImageEmojiType }>, twentyFourHourTime: boolean, subscriptions: Subscription[], @@ -89,7 +87,6 @@ type SelectorProps = {| showMessagePlaceholders: boolean, theme: ThemeName, typingUsers: $ReadOnlyArray, - isAnnouncementOnly: boolean, |}; // TODO get a type for `connectActionSheet` so this gets fully type-checked. @@ -343,7 +340,6 @@ export default connect((state, props: OuterProps) => { mute: getMute(state), ownEmail: getOwnEmail(state), ownUserId: getOwnUser(state).user_id, - isAdmin: getOwnUser(state).is_admin, allImageEmojiById: getAllImageEmojiById(state), subscriptions: getSubscriptions(state), twentyFourHourTime: getRealm(state).twentyFourHourTime, @@ -361,6 +357,5 @@ export default connect((state, props: OuterProps) => { : getShowMessagePlaceholders(props.narrow)(state), theme: getSettings(state).theme, typingUsers: props.typingUsers || getCurrentTypingUsers(state, props.narrow), - isAnnouncementOnly: getIsActiveStreamAnnouncementOnly(state, props.narrow), }; })(connectActionSheet(withGetText(MessageList))); diff --git a/src/webview/webViewEventHandlers.js b/src/webview/webViewEventHandlers.js index e1e50af334a..61463cd8f53 100644 --- a/src/webview/webViewEventHandlers.js +++ b/src/webview/webViewEventHandlers.js @@ -127,7 +127,6 @@ type Props = $ReadOnly<{ messages: $ReadOnlyArray, narrow: Narrow, showActionSheetWithOptions: ShowActionSheetWithOptions, - isAnnouncementOnly: boolean, }>; const fetchMore = (props: Props, event: MessageListEventScroll) => { @@ -181,18 +180,11 @@ const handleLongPress = ( if (!message) { return; } - const { - dispatch, - showActionSheetWithOptions, - backgroundData, - narrow, - isAnnouncementOnly, - } = props; + const { dispatch, showActionSheetWithOptions, backgroundData, narrow } = props; showActionSheet(target === 'header', dispatch, showActionSheetWithOptions, _, { backgroundData, message, narrow, - isAnnouncementOnly, }); }; diff --git a/static/translations/messages_en.json b/static/translations/messages_en.json index c9138e98ca0..10587c4a16e 100644 --- a/static/translations/messages_en.json +++ b/static/translations/messages_en.json @@ -47,7 +47,6 @@ "Narrow to conversation": "Narrow to conversation", "Reply": "Reply", "Add a reaction": "Add a reaction", - "Narrow to topic": "Narrow to topic", "Copy to clipboard": "Copy to clipboard", "Link copied to clipboard": "Link copied to clipboard", "Mute topic": "Mute topic", @@ -123,7 +122,6 @@ "Edit message": "Edit message", "Network request failed": "Network request failed", "Failed to add reaction": "Failed to add reaction", - "Failed to narrow to topic": "Failed to narrow to topic", "Failed to reply": "Failed to reply", "Failed to copy message to clipboard": "Failed to copy message to clipboard", "Failed to share message": "Failed to share message",