From 46a33baabbde39f4090816965ff26840143bae95 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Tue, 10 Feb 2026 11:25:05 +0300 Subject: Enha: stop tts if msg not for user --- helpfuncs.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'helpfuncs.go') diff --git a/helpfuncs.go b/helpfuncs.go index 538b4aa..b6b5faa 100644 --- a/helpfuncs.go +++ b/helpfuncs.go @@ -45,6 +45,18 @@ func refreshChatDisplay() { }) } +func stopTTSIfNotForUser(msg *models.RoleMsg) { + viewingAs := cfg.UserRole + if cfg.WriteNextMsgAs != "" { + viewingAs = cfg.WriteNextMsgAs + } + // stop tts if msg is not for user + if cfg.CharSpecificContextEnabled && + !slices.Contains(msg.KnownTo, viewingAs) && cfg.TTS_ENABLED { + TTSDoneChan <- true + } +} + func colorText() { text := textView.GetText(false) quoteReplacer := strings.NewReplacer( -- cgit v1.2.3