diff --git a/src/action-sheets/index.js b/src/action-sheets/index.js index 7bc8fff5736..fe4f6ba6553 100644 --- a/src/action-sheets/index.js +++ b/src/action-sheets/index.js @@ -692,6 +692,7 @@ export const constructMessageActionButtons = (args: {| |}): Button[] => { const { backgroundData, message, narrow, canStartQuoteAndReply } = args; const { ownUser, flags } = backgroundData; + const { role } = ownUser; const buttons = []; if (message.isOutbox === true) { @@ -730,6 +731,9 @@ export const constructMessageActionButtons = (args: {| // TODO(#2793): Don't show if message isn't deletable. buttons.push(deleteMessage); } + if (roleIsAtLeast(role, Role.Admin) && messageNotDeleted(message)) { + buttons.push(deleteMessage); + } if ( // When do we offer "Mark as unread from here"? This logic parallels // `should_display_mark_as_unread` in web's static/js/popovers.js . diff --git a/src/chat/ChatScreen.js b/src/chat/ChatScreen.js index 7e6af9438b0..05f61046379 100644 --- a/src/chat/ChatScreen.js +++ b/src/chat/ChatScreen.js @@ -164,7 +164,7 @@ export default function ChatScreen(props: Props): Node { () => undefined, ); - if ((content !== undefined && content !== '') || (topic !== undefined && topic !== '')) { + if (content !== undefined || topic !== undefined) { api.updateMessage(auth, editMessage.id, { content, subject: topic }).catch(error => { showErrorAlert(_('Failed to edit message'), error.message); }); diff --git a/src/compose/ComposeBox.js b/src/compose/ComposeBox.js index 46077101656..70825f800a6 100644 --- a/src/compose/ComposeBox.js +++ b/src/compose/ComposeBox.js @@ -521,7 +521,7 @@ const ComposeBox: React$AbstractComponent = forwardRef( result.push('mandatory-topic-empty'); } - if (messageInputValue.trim().length === 0) { + if (messageInputValue.trim().length === 0 && !isEditing) { result.push('message-empty'); } @@ -540,6 +540,7 @@ const ComposeBox: React$AbstractComponent = forwardRef( numUploading, anyQuoteAndReplyInProgress, messageInputState, + isEditing, ]); const submitButtonDisabled = validationErrors.length > 0;