Fix: character specific context tts

This commit is contained in:
Grail Finder
2026-02-22 17:45:09 +03:00
parent 9a727b21ad
commit 1e13c7796d

View File

@@ -108,14 +108,17 @@ func refreshChatDisplay() {
} }
} }
// stopTTSIfNotForUser: character specific context, not meant fot the human to hear
func stopTTSIfNotForUser(msg *models.RoleMsg) { func stopTTSIfNotForUser(msg *models.RoleMsg) {
if strings.Contains(cfg.CurrentAPI, "/chat") || !cfg.CharSpecificContextEnabled {
return
}
viewingAs := cfg.UserRole viewingAs := cfg.UserRole
if cfg.WriteNextMsgAs != "" { if cfg.WriteNextMsgAs != "" {
viewingAs = cfg.WriteNextMsgAs viewingAs = cfg.WriteNextMsgAs
} }
// stop tts if msg is not for user // stop tts if msg is not for user
if cfg.CharSpecificContextEnabled && if !slices.Contains(msg.KnownTo, viewingAs) && cfg.TTS_ENABLED {
!slices.Contains(msg.KnownTo, viewingAs) && cfg.TTS_ENABLED {
TTSDoneChan <- true TTSDoneChan <- true
} }
} }