diff options
author | Vincent Petry <vincent@nextcloud.com> | 2020-10-09 15:55:59 +0300 |
---|---|---|
committer | Vincent Petry <vincent@nextcloud.com> | 2020-10-13 17:54:30 +0300 |
commit | cbb16c00a5430ffca81c9c3d482046bad58cbad6 (patch) | |
tree | 15a393a3c91175199d67e6beb8f73f021f6fa218 /src | |
parent | 03128181d193f8a76d11d982954e92bb584868a2 (diff) |
Read-only conversation tweaks
Moved isConversationReadOnly condition on the reply action button
instead of affecting all possible (future) actions.
Now using `showError` instead of the global OC notification, the
displayed border now has the correct color.
Renamed "room" to "conversation" in the error message.
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/components/MessagesList/MessagesGroup/Message/Message.vue | 4 | ||||
-rw-r--r-- | src/components/NewMessageForm/NewMessageForm.vue | 12 |
2 files changed, 5 insertions, 11 deletions
diff --git a/src/components/MessagesList/MessagesGroup/Message/Message.vue b/src/components/MessagesList/MessagesGroup/Message/Message.vue index dfc4b8c65..6eeb94016 100644 --- a/src/components/MessagesList/MessagesGroup/Message/Message.vue +++ b/src/components/MessagesList/MessagesGroup/Message/Message.vue @@ -59,7 +59,7 @@ the main body of the message as well as a quote. {{ messageTime }} </h6> <Actions - v-show="showActions && hasActions && !isConversationReadOnly" + v-show="showActions && hasActions" class="message__main__right__actions"> <ActionButton v-if="isReplyable" @@ -217,7 +217,7 @@ export default { computed: { hasActions() { - return this.isReplyable + return this.isReplyable && !this.isConversationReadOnly }, isConversationReadOnly() { diff --git a/src/components/NewMessageForm/NewMessageForm.vue b/src/components/NewMessageForm/NewMessageForm.vue index 336591ce9..87d9a4837 100644 --- a/src/components/NewMessageForm/NewMessageForm.vue +++ b/src/components/NewMessageForm/NewMessageForm.vue @@ -96,7 +96,7 @@ <script> import AdvancedInput from './AdvancedInput/AdvancedInput' -import { getFilePickerBuilder } from '@nextcloud/dialogs' +import { getFilePickerBuilder, showError } from '@nextcloud/dialogs' import { postNewMessage } from '../../services/messagesService' import Quote from '../Quote' import Actions from '@nextcloud/vue/dist/Components/Actions' @@ -277,15 +277,9 @@ export default { } // 403 when room is read-only, 412 when switched to lobby mode if (statusCode === 403 || statusCode === 412) { - OC.Notification.show( - t('spreed', 'No permission to post messages in this room'), - { type: 'error' } - ) + showError(t('spreed', 'No permission to post messages in this conversation')) } else { - OC.Notification.show( - t('spreed', 'Could not post message: {errorMessage}', { errorMessage: error.message || error }), - { type: 'error' } - ) + showError(t('spreed', 'Could not post message: {errorMessage}', { errorMessage: error.message || error })) } // restore message to allow re-sending |