chore: Add message_echo listener for Facebook (#1192)

Co-authored-by: Sojan Jose <sojan@pepalo.com>
This commit is contained in:
Pranav Raj S
2020-09-04 19:13:47 +05:30
committed by GitHub
parent 715bd368f4
commit d18c8fc08a
12 changed files with 51 additions and 11 deletions

View File

@@ -17,6 +17,10 @@ class Channel::Api < ApplicationRecord
has_one :inbox, as: :channel, dependent: :destroy
def name
'API'
end
def has_24_hour_messaging_window?
false
end

View File

@@ -26,6 +26,10 @@ class Channel::Email < ApplicationRecord
has_one :inbox, as: :channel, dependent: :destroy
before_validation :ensure_forward_to_address, on: :create
def name
'Email'
end
def has_24_hour_messaging_window?
false
end

View File

@@ -28,6 +28,10 @@ class Channel::FacebookPage < ApplicationRecord
after_create_commit :subscribe
before_destroy :unsubscribe
def name
'Facebook'
end
def has_24_hour_messaging_window?
true
end

View File

@@ -30,11 +30,11 @@ class Channel::TwilioSms < ApplicationRecord
has_one :inbox, as: :channel, dependent: :destroy
def name
medium == :sms ? 'Twilio SMS' : 'Whatsapp'
end
def has_24_hour_messaging_window?
true
end
def name
'Twilio SMS'
end
end

View File

@@ -26,6 +26,10 @@ class Channel::TwitterProfile < ApplicationRecord
before_destroy :unsubscribe
def name
'Twitter'
end
def has_24_hour_messaging_window?
false
end

View File

@@ -33,6 +33,10 @@ class Channel::WebWidget < ApplicationRecord
2 => :emoji_picker,
:column => 'feature_flags'
def name
'Website'
end
def has_24_hour_messaging_window?
false
end

View File

@@ -66,6 +66,10 @@ class Inbox < ApplicationRecord
channel.class.name.to_s == 'Channel::WebWidget'
end
def inbox_type
channel.name
end
def webhook_data
{
id: id,