FIX: stream messages when directly PMing a persona (#500)

previous to this fix we did not consider personas a bot in the
front end
This commit is contained in:
Sam
2024-03-01 07:53:42 +11:00
committed by GitHub
parent 9fb1430e40
commit 59bab2bba3
3 changed files with 32 additions and 1 deletions
+8
View File
@@ -97,6 +97,14 @@ module DiscourseAi
SQL
bots.each { |hash| hash["model_name"] = model_map[hash["id"]] }
mentionables = AiPersona.mentionables(user: scope.user)
if mentionables.present?
bots.concat(
mentionables.map do |mentionable|
{ "id" => mentionable[:user_id], "username" => mentionable[:username] }
end,
)
end
bots
end