diff options
| author | Grail Finder <wohilas@gmail.com> | 2026-02-10 11:25:05 +0300 |
|---|---|---|
| committer | Grail Finder <wohilas@gmail.com> | 2026-02-10 11:25:05 +0300 |
| commit | 46a33baabbde39f4090816965ff26840143bae95 (patch) | |
| tree | e89c5bd1430acc875f6cb431c4edbb3fe9d1fc5e /helpfuncs.go | |
| parent | 875de679cf4732bbd70361d826d65d9d8b190add (diff) | |
Enha: stop tts if msg not for user
Diffstat (limited to 'helpfuncs.go')
| -rw-r--r-- | helpfuncs.go | 12 |
1 files changed, 12 insertions, 0 deletions
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( |
