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:
@@ -12,6 +12,8 @@ module Facebook
|
||||
|
||||
private
|
||||
|
||||
delegate :contact, to: :conversation
|
||||
|
||||
def inbox
|
||||
@inbox ||= message.inbox
|
||||
end
|
||||
@@ -20,10 +22,6 @@ module Facebook
|
||||
@conversation ||= message.conversation
|
||||
end
|
||||
|
||||
def sender
|
||||
conversation.sender
|
||||
end
|
||||
|
||||
def outgoing_message_from_chatwoot?
|
||||
# messages sent directly from chatwoot won't have fb_id.
|
||||
message.outgoing? && !message.fb_id
|
||||
@@ -37,7 +35,7 @@ module Facebook
|
||||
|
||||
def fb_message_params
|
||||
{
|
||||
recipient: { id: sender.source_id },
|
||||
recipient: { id: contact.source_id },
|
||||
message: { text: message.content }
|
||||
}
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user