Skip to content

Commit

Permalink
[FIX] Preview of image uploads were not working when apps framework i…
Browse files Browse the repository at this point in the history
…s enable (#13303)
  • Loading branch information
rodrigok authored and sampaiodiego committed Feb 1, 2019
1 parent 77fb258 commit ac1ed8e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/rocketchat-apps/server/converters/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,17 @@ export class AppMessagesConverter {
title: attachment.title ? attachment.title.value : undefined,
title_link: attachment.title ? attachment.title.link : undefined,
title_link_download: attachment.title ? attachment.title.displayDownloadLink : undefined,
image_dimensions: attachment.imageDimensions,
image_preview: attachment.imagePreview,
image_url: attachment.imageUrl,
image_type: attachment.imageType,
image_size: attachment.imageSize,
audio_url: attachment.audioUrl,
audio_type: attachment.audioType,
audio_size: attachment.audioSize,
video_url: attachment.videoUrl,
video_type: attachment.videoType,
video_size: attachment.videoSize,
fields: attachment.fields,
button_alignment: attachment.actionButtonsAlignment,
actions: attachment.actions,
Expand Down Expand Up @@ -185,9 +193,17 @@ export class AppMessagesConverter {
thumbnailUrl: attachment.thumb_url,
author,
title,
imageDimensions: attachment.image_dimensions,
imagePreview: attachment.image_preview,
imageUrl: attachment.image_url,
imageType: attachment.image_type,
imageSize: attachment.image_size,
audioUrl: attachment.audio_url,
audioType: attachment.audio_type,
audioSize: attachment.audio_size,
videoUrl: attachment.video_url,
videoType: attachment.video_type,
videoSize: attachment.video_size,
fields: attachment.fields,
actionButtonsAlignment: attachment.button_alignment,
actions: attachment.actions,
Expand Down
8 changes: 8 additions & 0 deletions packages/rocketchat-lib/server/functions/sendMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,17 @@ const validateAttachment = (attachment) => {
title: String,
title_link: String,
title_link_download: Boolean,
image_dimensions: Object,
image_url: String,
image_preview: String,
image_type: String,
image_size: Number,
audio_url: String,
audio_type: String,
audio_size: Number,
video_url: String,
video_type: String,
video_size: Number,
fields: [Match.Any],
}));

Expand Down

0 comments on commit ac1ed8e

Please sign in to comment.