Feature: Rich Message Types (#610)

Co-authored-by: Pranav Raj S <pranavrajs@gmail.com>
Co-authored-by: Nithin David Thomas <webofnithin@gmail.com>
This commit is contained in:
Sojan Jose
2020-04-10 16:42:37 +05:30
committed by GitHub
parent 48f603798b
commit b0950d6880
58 changed files with 997 additions and 146 deletions

View File

@@ -3,11 +3,13 @@ class Messages::Outgoing::NormalBuilder
attr_reader :message
def initialize(user, conversation, params)
@content = params[:message]
@content = params[:content]
@private = params[:private] || false
@conversation = conversation
@user = user
@fb_id = params[:fb_id]
@content_type = params[:content_type]
@items = params.to_unsafe_h&.dig(:content_attributes, :items)
@attachment = params[:attachment]
end
@@ -34,7 +36,9 @@ class Messages::Outgoing::NormalBuilder
content: @content,
private: @private,
user_id: @user&.id,
source_id: @fb_id
source_id: @fb_id,
content_type: @content_type,
items: @items
}
end
end