Initial Commit
Co-authored-by: Subin <subinthattaparambil@gmail.com> Co-authored-by: Manoj <manojmj92@gmail.com> Co-authored-by: Nithin <webofnithin@gmail.com>
This commit is contained in:
25
lib/integrations/facebook/delivery_status.rb
Normal file
25
lib/integrations/facebook/delivery_status.rb
Normal file
@@ -0,0 +1,25 @@
|
||||
class Integrations::Facebook::DeliveryStatus
|
||||
|
||||
def initialize(params)
|
||||
@params = params
|
||||
end
|
||||
|
||||
def perform
|
||||
update_message_status
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def sender_id
|
||||
@params.sender['id']
|
||||
end
|
||||
|
||||
def conversation
|
||||
@conversation ||= Conversation.find_by(sender_id: sender_id)
|
||||
end
|
||||
|
||||
def update_message_status
|
||||
conversation.user_last_seen_at = @params.at
|
||||
conversation.save!
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user