[Bug] Remove toggle_typing API call for channels except Facebook (#211)
This commit is contained in:
@@ -9,6 +9,10 @@ module Channel
|
||||
has_one :inbox, as: :channel, dependent: :destroy
|
||||
has_secure_token :website_token
|
||||
|
||||
def name
|
||||
'Website'
|
||||
end
|
||||
|
||||
def create_contact_inbox
|
||||
ActiveRecord::Base.transaction do
|
||||
contact = inbox.account.contacts.create!(name: ::Haikunator.haikunate(1000))
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
class FacebookPage < ApplicationRecord
|
||||
validates :account_id, presence: true
|
||||
validates_uniqueness_of :page_id, scope: :account_id
|
||||
mount_uploader :avatar, AvatarUploader
|
||||
belongs_to :account
|
||||
|
||||
has_one :inbox, as: :channel, dependent: :destroy
|
||||
|
||||
before_destroy :unsubscribe
|
||||
|
||||
def name
|
||||
'Facebook'
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def unsubscribe
|
||||
Facebook::Messenger::Subscriptions.unsubscribe(access_token: page_access_token)
|
||||
rescue StandardError => e
|
||||
true
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user