feat: support reply to for Telegram (#8105)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
@@ -19,6 +19,7 @@ class Telegram::IncomingMessageService
|
||||
inbox_id: @inbox.id,
|
||||
message_type: :incoming,
|
||||
sender: @contact,
|
||||
content_attributes: telegram_params_content_attributes,
|
||||
source_id: telegram_params_message_id.to_s
|
||||
)
|
||||
|
||||
|
||||
@@ -6,6 +6,13 @@ module Telegram::ParamHelpers
|
||||
params.dig(:message, :chat, :type) == 'private'
|
||||
end
|
||||
|
||||
def telegram_params_content_attributes
|
||||
reply_to = params.dig(:message, :reply_to_message, :message_id)
|
||||
return { 'in_reply_to_external_id' => reply_to } if reply_to
|
||||
|
||||
{}
|
||||
end
|
||||
|
||||
def message_params?
|
||||
params[:message].present?
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user