feat: Disable attachments and emoji picker in the web widget (#1102)
Signed-off-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
# Table name: channel_web_widgets
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# feature_flags :integer default(3), not null
|
||||
# website_token :string
|
||||
# website_url :string
|
||||
# welcome_tagline :string
|
||||
@@ -18,6 +19,8 @@
|
||||
#
|
||||
|
||||
class Channel::WebWidget < ApplicationRecord
|
||||
include FlagShihTzu
|
||||
|
||||
self.table_name = 'channel_web_widgets'
|
||||
|
||||
validates :website_url, presence: true
|
||||
@@ -26,6 +29,9 @@ class Channel::WebWidget < ApplicationRecord
|
||||
belongs_to :account
|
||||
has_one :inbox, as: :channel, dependent: :destroy
|
||||
has_secure_token :website_token
|
||||
has_flags 1 => :attachments,
|
||||
2 => :emoji_picker,
|
||||
:column => 'feature_flags'
|
||||
|
||||
def has_24_hour_messaging_window?
|
||||
false
|
||||
|
||||
@@ -46,6 +46,8 @@ class Inbox < ApplicationRecord
|
||||
|
||||
after_destroy :delete_round_robin_agents
|
||||
|
||||
scope :order_by_id, -> { order(id: :asc) }
|
||||
|
||||
def add_member(user_id)
|
||||
member = inbox_members.new(user_id: user_id)
|
||||
member.save!
|
||||
|
||||
Reference in New Issue
Block a user