Feat: Manage conversation for tweets based on the tweet flag (#3353)
Add tweet conversation only if tweets are enabled. Fixes #1961
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
# Table name: channel_twitter_profiles
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# tweets_enabled :boolean default(TRUE)
|
||||
# twitter_access_token :string not null
|
||||
# twitter_access_token_secret :string not null
|
||||
# created_at :datetime not null
|
||||
@@ -24,6 +25,8 @@ class Channel::TwitterProfile < ApplicationRecord
|
||||
|
||||
before_destroy :unsubscribe
|
||||
|
||||
EDITABLE_ATTRS = [:tweets_enabled].freeze
|
||||
|
||||
def name
|
||||
'Twitter'
|
||||
end
|
||||
|
||||
@@ -87,6 +87,10 @@ class Inbox < ApplicationRecord
|
||||
channel_type == 'Channel::TwilioSms'
|
||||
end
|
||||
|
||||
def twitter?
|
||||
channel_type == 'Channel::TwitterProfile'
|
||||
end
|
||||
|
||||
def inbox_type
|
||||
channel.name
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user