]> git.giacomolli.uk - onechat/blobdiff - telegram.go
Show the linked device as OneChat on the phone
[onechat] / telegram.go
index 16eff80c473eaba73d6cd5291b6aee7cdfc63a57..814f4544a2e7c942aeb9cb2741774a7960345f6f 100644 (file)
@@ -160,10 +160,15 @@ type TelegramBot struct {
 }
 
 // Notify queues event for the chat. It never blocks, so a slow network does not
 }
 
 // Notify queues event for the chat. It never blocks, so a slow network does not
-// stop the agent.
+// stop the agent. The WhatsApp batches do not go to the chat: the reply of the
+// agent tells the user what needs the user.
 func (b *TelegramBot) Notify(event Event) {
        switch event.Kind {
 func (b *TelegramBot) Notify(event Event) {
        switch event.Kind {
-       case "busy", "idle", "reply", "error", "notice", "subagent", "work":
+       case "busy", "idle", "reply", "error", "notice", "subagent":
+       case "work":
+               if event.Source == whatsappSource {
+                       return
+               }
        case "user":
                if event.Source == telegramSource {
                        return
        case "user":
                if event.Source == telegramSource {
                        return