X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/ec230eee6b06580031637bc97c99ec6db7b41926..0018014ab36f3de61a4b8a5515009dab803d6c38:/daemon.go?ds=inline diff --git a/daemon.go b/daemon.go index d67c5be..41b3ab6 100644 --- a/daemon.go +++ b/daemon.go @@ -305,8 +305,8 @@ func daemonListenSocket(path string) (net.Listener, error) { } // daemonServe runs the loop that start makes and serves the clients of listener -// until ctx ends or the loop fails. It closes listener. It keeps whatsapp -// connected. When bot is not nil, it runs the bot too, and a failure of the bot +// until ctx ends or the loop fails. It closes listener. It runs whatsapp, which +// logs its notes in the loop and tells all clients its notices. When bot is not nil, it runs the bot too, and a failure of the bot // stops the agent. func daemonServe(ctx context.Context, listener net.Listener, bot *TelegramBot, whatsapp *WhatsApp, start func(notify func(Event)) (*TurnLoop, error)) error { ctx, cancel := context.WithCancel(ctx) @@ -341,7 +341,7 @@ func daemonServe(ctx context.Context, listener net.Listener, bot *TelegramBot, w go func() { defer workers.Done() - whatsapp.Run(ctx) + whatsapp.Run(ctx, l, notify) }() var botErr error