Change sender_id to contact_id in conversations (#167)
* change sender_id to contact_id in conversations * Fix failing tests * Fix seeds * fix specs * Fix issues in facebook messenger
This commit is contained in:
@@ -1,48 +1,52 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Integrations::Facebook::MessageParser
|
||||
def initialize(response_json)
|
||||
@response = response_json
|
||||
end
|
||||
module Integrations
|
||||
module Facebook
|
||||
class MessageParser
|
||||
def initialize(response_json)
|
||||
@response = response_json
|
||||
end
|
||||
|
||||
def sender_id
|
||||
@response.sender['id']
|
||||
end
|
||||
def sender_id
|
||||
@response.sender['id']
|
||||
end
|
||||
|
||||
def recipient_id
|
||||
@response.recipient['id']
|
||||
end
|
||||
def recipient_id
|
||||
@response.recipient['id']
|
||||
end
|
||||
|
||||
def time_stamp
|
||||
@response.sent_at
|
||||
end
|
||||
def time_stamp
|
||||
@response.sent_at
|
||||
end
|
||||
|
||||
def content
|
||||
@response.text
|
||||
end
|
||||
def content
|
||||
@response.text
|
||||
end
|
||||
|
||||
def sequence
|
||||
@response.seq
|
||||
end
|
||||
def sequence
|
||||
@response.seq
|
||||
end
|
||||
|
||||
def attachments
|
||||
@response.attachments
|
||||
end
|
||||
def attachments
|
||||
@response.attachments
|
||||
end
|
||||
|
||||
def identifier
|
||||
@response.id
|
||||
end
|
||||
def identifier
|
||||
@response.id
|
||||
end
|
||||
|
||||
def echo?
|
||||
@response.echo?
|
||||
end
|
||||
def echo?
|
||||
@response.echo?
|
||||
end
|
||||
|
||||
def app_id
|
||||
@response.app_id
|
||||
end
|
||||
def app_id
|
||||
@response.app_id
|
||||
end
|
||||
|
||||
def sent_from_chatwoot_app?
|
||||
app_id && app_id == ENV['fb_app_id'].to_i
|
||||
def sent_from_chatwoot_app?
|
||||
app_id && app_id == ENV['fb_app_id'].to_i
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user