merged from gramsrv upstream

This commit is contained in:
onysd 2026-09-01 12:06:31 +03:00
parent 79c64ee916
commit 21a0856587
651 changed files with 54774 additions and 4590 deletions

View file

@ -9,6 +9,14 @@ import (
"telesrv/internal/domain"
)
func (s *PasswordStore) HasBusinessAutomation(_ context.Context, userID int64) (bool, error) {
s.mu.RLock()
profile, hasProfile := s.businessProfiles[userID]
bot, hasBot := s.connectedBusinessBots[userID]
s.mu.RUnlock()
return hasProfile && (profile.Greeting != nil || profile.Away != nil) || hasBot && bot.BotUserID != 0, nil
}
func (s *PasswordStore) GetBusinessProfile(_ context.Context, userID int64) (domain.BusinessProfile, bool, error) {
s.mu.RLock()
profile, ok := s.businessProfiles[userID]