mirror of
https://github.com/lingble/chatwoot.git
synced 2025-12-01 10:33:52 +00:00
Fixes location messages not appearing in conversations when sent via Twilio. Location messages were being filtered out due to empty body content and missing parameter handling. 
37 lines
726 B
Ruby
37 lines
726 B
Ruby
class Twilio::CallbackController < ApplicationController
|
|
def create
|
|
Webhooks::TwilioEventsJob.perform_later(permitted_params.to_unsafe_hash)
|
|
|
|
head :no_content
|
|
end
|
|
|
|
private
|
|
|
|
def permitted_params # rubocop:disable Metrics/MethodLength
|
|
params.permit(
|
|
:ApiVersion,
|
|
:SmsSid,
|
|
:From,
|
|
:ToState,
|
|
:ToZip,
|
|
:AccountSid,
|
|
:MessageSid,
|
|
:FromCountry,
|
|
:ToCity,
|
|
:FromCity,
|
|
:To,
|
|
:FromZip,
|
|
:Body,
|
|
:ToCountry,
|
|
:FromState,
|
|
*Array.new(10) { |i| :"MediaUrl#{i}" },
|
|
*Array.new(10) { |i| :"MediaContentType#{i}" },
|
|
:MessagingServiceSid,
|
|
:NumMedia,
|
|
:Latitude,
|
|
:Longitude,
|
|
:MessageType
|
|
)
|
|
end
|
|
end
|