Merge branch 'release/1.21.0' into develop
This commit is contained in:
@@ -38,7 +38,9 @@ class Webhooks::InstagramEventsJob < ApplicationJob
|
|||||||
|
|
||||||
def create_test_text
|
def create_test_text
|
||||||
messenger_channel = Channel::FacebookPage.last
|
messenger_channel = Channel::FacebookPage.last
|
||||||
@inbox = ::Inbox.find_by!(channel: messenger_channel)
|
@inbox = ::Inbox.find_by(channel: messenger_channel)
|
||||||
|
return unless @inbox
|
||||||
|
|
||||||
@contact_inbox = @inbox.contact_inboxes.where(source_id: 'sender_username').first
|
@contact_inbox = @inbox.contact_inboxes.where(source_id: 'sender_username').first
|
||||||
unless @contact_inbox
|
unless @contact_inbox
|
||||||
@contact_inbox ||= @inbox.channel.create_contact_inbox(
|
@contact_inbox ||= @inbox.channel.create_contact_inbox(
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ class User < ApplicationRecord
|
|||||||
has_many :inbox_members, dependent: :destroy
|
has_many :inbox_members, dependent: :destroy
|
||||||
has_many :inboxes, through: :inbox_members, source: :inbox
|
has_many :inboxes, through: :inbox_members, source: :inbox
|
||||||
has_many :messages, as: :sender
|
has_many :messages, as: :sender
|
||||||
has_many :invitees, through: :account_users, class_name: 'User', foreign_key: 'inviter_id', dependent: :nullify
|
has_many :invitees, through: :account_users, class_name: 'User', foreign_key: 'inviter_id', source: :inviter, dependent: :nullify
|
||||||
|
|
||||||
has_many :notifications, dependent: :destroy
|
has_many :notifications, dependent: :destroy
|
||||||
has_many :notification_settings, dependent: :destroy
|
has_many :notification_settings, dependent: :destroy
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ class Instagram::MessageText < Instagram::WebhooksBaseService
|
|||||||
[@messaging[:recipient][:id], @messaging[:sender][:id]]
|
[@messaging[:recipient][:id], @messaging[:sender][:id]]
|
||||||
end
|
end
|
||||||
inbox_channel(instagram_id)
|
inbox_channel(instagram_id)
|
||||||
|
# person can connect the channel and then delete the inbox
|
||||||
|
return if @inbox.blank?
|
||||||
|
|
||||||
ensure_contact(contact_id)
|
ensure_contact(contact_id)
|
||||||
|
|
||||||
create_message
|
create_message
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ class Instagram::WebhooksBaseService
|
|||||||
|
|
||||||
def inbox_channel(instagram_id)
|
def inbox_channel(instagram_id)
|
||||||
messenger_channel = Channel::FacebookPage.where(instagram_id: instagram_id)
|
messenger_channel = Channel::FacebookPage.where(instagram_id: instagram_id)
|
||||||
@inbox = ::Inbox.find_by!(channel: messenger_channel)
|
@inbox = ::Inbox.find_by(channel: messenger_channel)
|
||||||
end
|
end
|
||||||
|
|
||||||
def find_or_create_contact(user)
|
def find_or_create_contact(user)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
shared: &shared
|
shared: &shared
|
||||||
version: '1.20.0'
|
version: '1.21.0'
|
||||||
|
|
||||||
development:
|
development:
|
||||||
<<: *shared
|
<<: *shared
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@chatwoot/chatwoot",
|
"name": "@chatwoot/chatwoot",
|
||||||
"version": "1.20.0",
|
"version": "1.21.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"eslint": "eslint app/javascript --fix",
|
"eslint": "eslint app/javascript --fix",
|
||||||
|
|||||||
Reference in New Issue
Block a user