Skip to content

Commit

Permalink
fix(Quote): don't trim the quote when it is not image share with caption
Browse files Browse the repository at this point in the history
Signed-off-by: DorraJaouad <[email protected]>
  • Loading branch information
DorraJaouad committed Dec 13, 2023
1 parent bb89b3f commit 2e3e421
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,8 @@ export default {
// Fallback for loading mimeicons (preview for audio files is not provided)
if (this.previewAvailable !== 'yes' || this.mimetype.startsWith('audio/')) {
return {
width: '128px',
height: '128px',
width: this.smallPreview ? '32px' : '128px',
height: this.smallPreview ? '32px' : '128px',
}
}
Expand Down
17 changes: 14 additions & 3 deletions src/components/Quote.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ components.
<!-- file preview-->
<NcRichText v-if="isFileShareMessage"
text="{file}"
class="quote__file-preview"
:class="{'quote__image-preview' : isImageWithCaption}"
:arguments="richParameters" />
<!-- text -->
<blockquote v-if="!isFileShareWithoutCaption"
Expand Down Expand Up @@ -146,6 +146,12 @@ export default {
return { AVATAR }
},
data() {
return {
mimetype: '',
}
},
computed: {
/**
* The message actor display name.
Expand Down Expand Up @@ -184,6 +190,7 @@ export default {
Object.keys(this.messageParameters).forEach(function(p) {
const type = this.messageParameters[p].type
if (type === 'file') {
this.mimetype = this.messageParameters[p].mimetype
richParameters[p] = {
component: FilePreview,
props: Object.assign({
Expand All @@ -201,6 +208,10 @@ export default {
return richParameters
},
isImageWithCaption() {
return this.isFileShareMessage && this.mimetype.startsWith('image/') && this.message !== '{file}'
},
/**
* This is a simplified version of the last chat message.
* Parameters are parsed without markup (just replaced with the name),
Expand Down Expand Up @@ -328,8 +339,8 @@ export default {
position: relative;
margin: auto;
}
&__file-preview {
line-height: 0.5 !important;
&__image-preview {
line-height: 1 !important;
}
}
Expand Down

0 comments on commit 2e3e421

Please sign in to comment.