Mercurial Hosting > lang
comparison src/lib/ai/claude/Ai_chat.luan @ 41:2a4c83ce3deb
public chat
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 11 Aug 2025 07:58:32 +0900 |
parents | 6cdb2c761e08 |
children | 5ecfdf43f72d |
comparison
equal
deleted
inserted
replaced
40:6cdb2c761e08 | 41:2a4c83ce3deb |
---|---|
91 } | 91 } |
92 } | 92 } |
93 } | 93 } |
94 fn = function(input) | 94 fn = function(input) |
95 local Chat = require "site:/lib/Chat.luan" | 95 local Chat = require "site:/lib/Chat.luan" |
96 local User = require "site:/lib/User.luan" | |
96 local thread_id = input.thread_id or error() | 97 local thread_id = input.thread_id or error() |
97 local chat = Chat.get_by_id(thread_id) or error | 98 local chat = Chat.get_by_id(thread_id) or error |
99 local user = User.current_user() | |
100 local is_owner = user ~= nil and user.id == chat.user_id | |
101 is_owner or not chat.is_private or error "private" | |
98 return chat.ai_thread or error() | 102 return chat.ai_thread or error() |
99 end | 103 end |
100 } | 104 } |
101 } | 105 } |
102 local tools = {nil} | 106 local tools = {nil} |