fix: the assistant's web search and page reading on by default, as the chat - they refused («ассистент выключен в профиле») anyone who never touched the switch

This commit is contained in:
redtea committed 2026-10-18 11:26:20 +03:00
1 parent 114f8b1e1b
commit 054fc97da8
4 files changed
+51 -3

No files matched your search

+1 -1
View File
@@ -179,7 +179,7 @@ func pageText(page string) (string, string) {
// assistant on.
func (s *Server) handleAIFetch(w http.ResponseWriter, r *http.Request) {
a := s.currentAdmin(r)
if on, _ := s.db.GetConfig(aiUserKey(a.ID)); on != "1" {
if !s.aiOn(a.ID) {
writeJSON(w, map[string]any{"ok": false, "error": "ассистент выключен в профиле"})
return
}