-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8874 from nextcloud/backport/8855/stable3.4
[stable3.4] fix(composer): forward messages as attachments
- Loading branch information
Showing
5 changed files
with
39 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
- @copyright 2020 Gary Kim <[email protected]> | ||
- | ||
- @author 2018 Christoph Wurst <[email protected]> | ||
- @author Richard Steinmetz <[email protected]> | ||
- | ||
- @license AGPL-3.0-or-later | ||
- | ||
|
@@ -166,6 +167,7 @@ export default { | |
this.bus.$on('on-add-local-attachment', this.onAddLocalAttachment) | ||
this.bus.$on('on-add-cloud-attachment', this.onAddCloudAttachment) | ||
this.bus.$on('on-add-cloud-attachment-link', this.onAddCloudAttachmentLink) | ||
this.bus.$on('on-add-message-as-attachment', this.onAddMessageAsAttachment) | ||
this.value.map(attachment => { | ||
this.attachments.push({ | ||
id: attachment.id, | ||
|
@@ -341,6 +343,25 @@ export default { | |
logger.error('could not choose a file as attachment link', { error }) | ||
} | ||
}, | ||
/** | ||
* Add a forwarded message as an attachment | ||
* | ||
* @param {object} data Payload | ||
* @param {number} data.id Database id of the message to forward as an attachment | ||
* @param {string} data.fileName File name of the attachment | ||
*/ | ||
onAddMessageAsAttachment({ id, fileName }) { | ||
const attachment = { | ||
type: 'message', | ||
id, | ||
fileName, | ||
} | ||
this.attachments.push({ | ||
...attachment, | ||
finished: true, | ||
}) | ||
this.emitNewAttachments([attachment]) | ||
}, | ||
showAttachmentFileSizeWarning(num) { | ||
showWarning(n( | ||
'mail', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters