From 166b6c15f7404bac89e4c9069b91650bff97305a Mon Sep 17 00:00:00 2001 From: DorraJaouad Date: Tue, 5 Dec 2023 09:39:03 +0100 Subject: [PATCH 1/2] fix(Quote): Add file preview in reply with its shortened caption Signed-off-by: DorraJaouad --- src/components/Quote.vue | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/components/Quote.vue b/src/components/Quote.vue index 2e503962dd6..8e3eb56e1e3 100644 --- a/src/components/Quote.vue +++ b/src/components/Quote.vue @@ -41,13 +41,13 @@ components. disable-menu /> {{ getDisplayName }} -
- -
-
+ + +

{{ shortenedQuoteMessage }}

@@ -175,6 +175,10 @@ export default { return Object.keys(Object(this.messageParameters)).some(key => key.startsWith('file')) }, + isFileShareWithoutCaption() { + return this.isFileShareMessage && this.message === '{file}' + }, + richParameters() { const richParameters = {} Object.keys(this.messageParameters).forEach(function(p) { @@ -324,6 +328,9 @@ export default { position: relative; margin: auto; } + &__file-preview { + line-height: 0.5 !important; + } } From b8afbf257f222ac590f3afe31442002e139f5936 Mon Sep 17 00:00:00 2001 From: DorraJaouad Date: Tue, 5 Dec 2023 12:04:15 +0100 Subject: [PATCH 2/2] fix(NewMessage): store caption without html escaping Signed-off-by: DorraJaouad --- src/components/NewMessage/NewMessage.vue | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/components/NewMessage/NewMessage.vue b/src/components/NewMessage/NewMessage.vue index 4d539213c82..caa1f9d2607 100644 --- a/src/components/NewMessage/NewMessage.vue +++ b/src/components/NewMessage/NewMessage.vue @@ -506,6 +506,14 @@ export default { } } + // FIXME upstream: https://github.com/nextcloud-libraries/nextcloud-vue/issues/4492 + if (this.hasText) { + const temp = document.createElement('textarea') + temp.innerHTML = this.text.replace(/&/gmi, '&') + this.text = temp.value.replace(/&/gmi, '&').replace(/</gmi, '<') + .replace(/>/gmi, '>').replace(/§/gmi, '§') + } + if (this.upload) { // Clear input content from store this.$store.dispatch('setCurrentMessageInput', { token: this.token, text: '' }) @@ -521,12 +529,6 @@ export default { } if (this.hasText) { - // FIXME upstream: https://github.com/nextcloud-libraries/nextcloud-vue/issues/4492 - const temp = document.createElement('textarea') - temp.innerHTML = this.text.replace(/&/gmi, '&') - this.text = temp.value.replace(/&/gmi, '&').replace(/</gmi, '<') - .replace(/>/gmi, '>').replace(/§/gmi, '§') - const temporaryMessage = await this.$store.dispatch('createTemporaryMessage', { text: this.text.trim(), token: this.token,