feat: Render instagram reels in Chatwoot (#9829)

- Previously we were ignoring the reels shared over Instagram messages.
This PR will render the reels with in Chatwoot.

followup : we need to render reels in a better interface so that it is
clearly denoted to the user that its an Instagram reel
This commit is contained in:
Sojan Jose
2024-07-24 12:58:12 -07:00
committed by GitHub
parent 71073a06ff
commit 8e2b329202
7 changed files with 73 additions and 5 deletions

View File

@@ -204,6 +204,42 @@ FactoryBot.define do
initialize_with { attributes }
end
factory :instagram_shared_reel_event, class: Hash do
entry do
[
{
'id': 'instagram-message-id-1234',
'time': '2021-09-08T06:34:04+0000',
'messaging': [
{
'sender': {
'id': 'Sender-id-1'
},
'recipient': {
'id': 'chatwoot-app-user-id-1'
},
'timestamp': '2021-09-08T06:34:04+0000',
'message': {
'mid': 'message-id-1',
'attachments': [
{
'type': 'ig_reel',
'payload': {
'reel_video_id': '1234',
'title': 'Reel title',
'url': 'https://www.example.com/test.jpeg'
}
}
]
}
}
]
}
]
end
initialize_with { attributes }
end
factory :instagram_story_mention_event, class: Hash do
entry do
[