Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Check capabilities for upload and gif size
Add capability check for allowing attachments.
Fix gif preview max size capability check.

Signed-off-by: Vincent Petry <[email protected]>
  • Loading branch information
PVince81 committed Jan 27, 2021
commit 3418902ac7b5d39f5a3a30111b3b86b26e0f041d
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,7 @@ export default {
if (this.previewAvailable !== 'yes') {
return PREVIEW_TYPE.MIME_ICON
}

const maxGifSize = getCapabilities()?.caps?.spreed?.config?.previews?.['max-gif-size'] || 3145728
const maxGifSize = getCapabilities()?.spreed?.config?.previews?.['max-gif-size'] || 3145728
if (this.mimetype === 'image/gif' && this.size <= maxGifSize) {
return PREVIEW_TYPE.DIRECT
}
Expand Down
4 changes: 3 additions & 1 deletion src/components/NewMessageForm/NewMessageForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
import AdvancedInput from './AdvancedInput/AdvancedInput'
import { getFilePickerBuilder, showError } from '@nextcloud/dialogs'
import { postNewMessage } from '../../services/messagesService'
import { getCapabilities } from '@nextcloud/capabilities'
import Quote from '../Quote'
import Actions from '@nextcloud/vue/dist/Components/Actions'
import ActionButton from '@nextcloud/vue/dist/Components/ActionButton'
Expand Down Expand Up @@ -195,7 +196,8 @@ export default {
},

canShareAndUploadFiles() {
return !this.currentUserIsGuest && !this.isReadOnly
const allowed = getCapabilities()?.spreed?.config?.attachments?.allowed
return allowed && !this.currentUserIsGuest && !this.isReadOnly
},

attachmentFolder() {
Expand Down