Fix: character specific context tts
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user