Progress
hashtag in top of tag feed, scroll to comment, chat blocking, muting, filtering
This commit is contained in:
@@ -15,26 +15,36 @@ class CreateChatConversationService < BaseService
|
||||
|
||||
# : todo :
|
||||
# check if allow anyone to message then create with approved:true
|
||||
# unique account id, participants
|
||||
|
||||
chat_conversation = ChatConversation.create
|
||||
@chat_conversation = ChatConversation.create
|
||||
|
||||
my_chat = ChatConversationAccount.create!(
|
||||
account: current_account,
|
||||
participant_account_ids: [@account.id.to_s],
|
||||
chat_conversation: chat_conversation,
|
||||
account: @current_account,
|
||||
participant_account_ids: account_ids_as_array,
|
||||
chat_conversation: @chat_conversation,
|
||||
is_approved: true
|
||||
)
|
||||
|
||||
# : todo : if multiple ids
|
||||
if @account.id != current_account.id
|
||||
their_chat = ChatConversationAccount.create!(
|
||||
account: @account,
|
||||
participant_account_ids: [current_account.id.to_s],
|
||||
chat_conversation: chat_conversation,
|
||||
is_approved: false # : todo : check if allow all else default as request
|
||||
)
|
||||
if @other_accounts.length == 1 && @other_accounts[0].id == @current_account.id
|
||||
# dont create two conversations if you are chatting with yourself
|
||||
else
|
||||
for other_account in @other_accounts
|
||||
this_conversation_participants = @other_accounts.map { |account|
|
||||
account.id.to_s
|
||||
}.reject { |id| id == other_account.id.to_s } << @current_account.id.to_s
|
||||
|
||||
# is_approved = other_account&.user&.setting_chat_messages_restrict_non_followers == true
|
||||
|
||||
ChatConversationAccount.create!(
|
||||
account: other_account,
|
||||
participant_account_ids: this_conversation_participants,
|
||||
chat_conversation: @chat_conversation,
|
||||
is_approved: false
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
my_chat
|
||||
end
|
||||
|
||||
def account_ids_as_array
|
||||
|
||||
Reference in New Issue
Block a user