1
0
Fork 0

Add full support for groups in the private message action

Dieser Commit ist enthalten in:
Angus McLeod 2020-10-05 13:41:18 +11:00
Ursprung 1087facb54
Commit fc5279cd0a

Datei anzeigen

@ -69,13 +69,29 @@ class CustomWizard::Action
end end
params = basic_topic_params params = basic_topic_params
params[:target_usernames] = CustomWizard::Mapper.new(
targets = CustomWizard::Mapper.new(
inputs: action['recipient'], inputs: action['recipient'],
data: data, data: data,
user: user user: user,
multiple: true
).perform ).perform
targets.each do |target|
if Group.find_by(name: target)
params[:target_group_names] = target
elsif User.find_by_username(target)
params[:target_usernames] = target
else
#
end
end
if params[:title].present? && params[:raw].present? && params[:target_usernames].present? if params[:title].present? &&
params[:raw].present? &&
(params[:target_usernames].present? ||
params[:target_group_names].present?)
params[:archetype] = Archetype.private_message params[:archetype] = Archetype.private_message
creator = PostCreator.new(user, params) creator = PostCreator.new(user, params)