feat: Add support for Instagram delivery reports (#8125)

This commit is contained in:
Muhsin Keloth
2023-10-19 12:12:34 +05:30
committed by GitHub
parent 04c874fe35
commit 78ce8a4652
6 changed files with 118 additions and 2 deletions

View File

@@ -7,7 +7,7 @@ class Webhooks::InstagramEventsJob < MutexApplicationJob
base_uri 'https://graph.facebook.com/v11.0/me'
# @return [Array] We will support further events like reaction or seen in future
SUPPORTED_EVENTS = [:message].freeze
SUPPORTED_EVENTS = [:message, :read].freeze
def perform(entries)
@entries = entries
@@ -45,6 +45,10 @@ class Webhooks::InstagramEventsJob < MutexApplicationJob
::Instagram::MessageText.new(messaging).perform
end
def read(messaging)
::Instagram::ReadStatusService.new(params: messaging).perform
end
def messages(entry)
(entry[:messaging].presence || entry[:standby] || [])
end