diff --git a/app/javascript/dashboard/components/widgets/WootWriter/ReplyBottomPanel.vue b/app/javascript/dashboard/components/widgets/WootWriter/ReplyBottomPanel.vue index eb9b26f30..b5022c9a2 100644 --- a/app/javascript/dashboard/components/widgets/WootWriter/ReplyBottomPanel.vue +++ b/app/javascript/dashboard/components/widgets/WootWriter/ReplyBottomPanel.vue @@ -144,6 +144,7 @@ import { FEATURE_FLAGS } from 'dashboard/featureFlags'; import { ALLOWED_FILE_TYPES, ALLOWED_FILE_TYPES_FOR_TWILIO_WHATSAPP, + ALLOWED_FILE_TYPES_FOR_LINE, } from 'shared/constants/messages'; import VideoCallButton from '../VideoCallButton.vue'; import AIAssistanceButton from '../AIAssistanceButton.vue'; @@ -270,6 +271,9 @@ export default { return this.showFileUpload || this.isNote; }, showAudioRecorderButton() { + if (this.isALineChannel) { + return false; + } // Disable audio recorder for safari browser as recording is not supported const isSafari = /^((?!chrome|android|crios|fxios).)*safari/i.test( navigator.userAgent @@ -291,6 +295,9 @@ export default { if (this.isATwilioWhatsAppChannel) { return ALLOWED_FILE_TYPES_FOR_TWILIO_WHATSAPP; } + if (this.isALineChannel) { + return ALLOWED_FILE_TYPES_FOR_LINE; + } return ALLOWED_FILE_TYPES; }, enableDragAndDrop() { diff --git a/app/javascript/shared/constants/messages.js b/app/javascript/shared/constants/messages.js index 1cf24f6a4..b53ca6826 100644 --- a/app/javascript/shared/constants/messages.js +++ b/app/javascript/shared/constants/messages.js @@ -55,6 +55,8 @@ export const ALLOWED_FILE_TYPES_FOR_TWILIO_WHATSAPP = 'audio/mpeg, audio/opus, audio/ogg, audio/amr,' + 'video/mp4,' + 'application/pdf,'; +// https://developers.line.biz/en/reference/messaging-api/#image-message, https://developers.line.biz/en/reference/messaging-api/#video-message +export const ALLOWED_FILE_TYPES_FOR_LINE = 'image/png, image/jpeg,video/mp4'; export const CSAT_RATINGS = [ { diff --git a/app/services/line/send_on_line_service.rb b/app/services/line/send_on_line_service.rb index e41f3f842..623223a1e 100644 --- a/app/services/line/send_on_line_service.rb +++ b/app/services/line/send_on_line_service.rb @@ -33,6 +33,9 @@ class Line::SendOnLineService < Base::SendOnChannelService def attachments message.attachments.map do |attachment| + # Support only image and video for now + next unless attachment.file_type == 'image' || attachment.file_type == 'video' + { type: attachment.file_type, originalContentUrl: attachment.download_url,