diff --git a/pkg/channels/whatsapp_native/init.go b/pkg/channels/whatsapp_native/init.go index df13e8539..2deee2297 100644 --- a/pkg/channels/whatsapp_native/init.go +++ b/pkg/channels/whatsapp_native/init.go @@ -15,6 +15,6 @@ func init() { if storePath == "" { storePath = filepath.Join(cfg.WorkspacePath(), "whatsapp") } - return NewWhatsAppNativeChannel(waCfg, b, storePath) + return NewWhatsAppNativeChannel(waCfg, cfg.Voice, b, storePath) }) } diff --git a/pkg/channels/whatsapp_native/whatsapp_native.go b/pkg/channels/whatsapp_native/whatsapp_native.go index 1756a4bc5..8eb90003f 100644 --- a/pkg/channels/whatsapp_native/whatsapp_native.go +++ b/pkg/channels/whatsapp_native/whatsapp_native.go @@ -51,6 +51,7 @@ const ( type WhatsAppNativeChannel struct { *channels.BaseChannel config config.WhatsAppConfig + voiceConfig config.VoiceConfig storePath string client *whatsmeow.Client container *sqlstore.Container @@ -67,6 +68,7 @@ type WhatsAppNativeChannel struct { // storePath is the directory for the SQLite session store (e.g. workspace/whatsapp). func NewWhatsAppNativeChannel( cfg config.WhatsAppConfig, + voiceCfg config.VoiceConfig, bus *bus.MessageBus, storePath string, ) (channels.Channel, error) { @@ -80,6 +82,7 @@ func NewWhatsAppNativeChannel( c := &WhatsAppNativeChannel{ BaseChannel: base, config: cfg, + voiceConfig: voiceCfg, storePath: storePath, } return c, nil @@ -428,7 +431,7 @@ func (c *WhatsAppNativeChannel) handleIncoming(evt *events.Message) { metadata["peer_kind"] = "direct" metadata["peer_id"] = senderID } - if len(mediaPaths) > 0 && c.config.EchoTranscription { + if len(mediaPaths) > 0 && c.voiceConfig.EchoTranscription { metadata["echo_transcription"] = "true" } diff --git a/pkg/channels/whatsapp_native/whatsapp_native_stub.go b/pkg/channels/whatsapp_native/whatsapp_native_stub.go index 984af23e7..bf74416f3 100644 --- a/pkg/channels/whatsapp_native/whatsapp_native_stub.go +++ b/pkg/channels/whatsapp_native/whatsapp_native_stub.go @@ -14,6 +14,7 @@ import ( // Build with: go build -tags whatsapp_native ./cmd/... func NewWhatsAppNativeChannel( cfg config.WhatsAppConfig, + voiceCfg config.VoiceConfig, bus *bus.MessageBus, storePath string, ) (channels.Channel, error) {