diff --git a/app/containers/MessageActions/index.tsx b/app/containers/MessageActions/index.tsx index 1f90e772b..e67d029df 100644 --- a/app/containers/MessageActions/index.tsx +++ b/app/containers/MessageActions/index.tsx @@ -454,12 +454,13 @@ const MessageActions = React.memo( }); // Edit - if (!videoConfBlock) { + const isEditAllowed = allowEdit(message); + if (!videoConfBlock && (isOwn(message) || isEditAllowed)) { options.push({ title: I18n.t('Edit'), icon: 'edit', onPress: () => handleEdit(message), - enabled: allowEdit(message) + enabled: isEditAllowed }); } @@ -518,13 +519,16 @@ const MessageActions = React.memo( }); // Delete - options.push({ - title: I18n.t('Delete'), - icon: 'delete', - danger: true, - onPress: () => handleDelete(message), - enabled: allowDelete(message) - }); + const isDeleteAllowed = allowDelete(message); + if (isOwn(message) || isDeleteAllowed) { + options.push({ + title: I18n.t('Delete'), + icon: 'delete', + danger: true, + onPress: () => handleDelete(message), + enabled: isDeleteAllowed + }); + } return options; }; diff --git a/e2e/tests/room/11-autoTranslate.spec.ts b/e2e/tests/room/11-autoTranslate.spec.ts index b8fe76db4..df7ba928b 100644 --- a/e2e/tests/room/11-autoTranslate.spec.ts +++ b/e2e/tests/room/11-autoTranslate.spec.ts @@ -186,7 +186,7 @@ describe('Auto Translate', () => { await waitForVisible('action-sheet-handle'); await element(by.id('action-sheet-handle')).swipe('up', 'fast', 0.5); - await element(by[textMatcher]('Edit')).atIndex(0).swipe('up', 'fast', 0.5); + await element(by[textMatcher]('Get link')).atIndex(0).swipe('up', 'fast', 0.5); await waitForVisibleTextMatcher('View original', textMatcher); await element(by[textMatcher]('View original')).atIndex(0).tap();