From dfdcfa3725c32a228db5db6871af4aa972f229b8 Mon Sep 17 00:00:00 2001 From: Bernhard B Date: Thu, 4 Apr 2024 19:58:03 +0200 Subject: [PATCH] fixed bug in send method * with signal-cli 0.13.0 the default behavior changed and message to oneself did not trigger a notification anymore. As this is a behavioral change and we try to avoid any behavioral changes in the REST API, the previous behavior was reinstated again by explicitly adding "--notify-self". see #511 --- src/client/client.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/client/client.go b/src/client/client.go index 02777a65..80d0d366 100644 --- a/src/client/client.go +++ b/src/client/client.go @@ -410,6 +410,7 @@ func (s *SignalClient) send(number string, message string, QuoteMentions []string `json:"quote-mentions,omitempty"` TextStyles []string `json:"text-style,omitempty"` EditTimestamp *int64 `json:"edit-timestamp,omitempty"` + NotifySelf bool `json:"notify-self,omitempty"` } request := Request{Message: message} @@ -422,6 +423,8 @@ func (s *SignalClient) send(number string, message string, request.Attachments = append(request.Attachments, attachmentEntry.toDataForSignal()) } + request.NotifySelf = true + request.Sticker = sticker if mentions != nil { request.Mentions = make([]string, len(mentions)) @@ -518,6 +521,8 @@ func (s *SignalClient) send(number string, message string, cmd = append(cmd, strconv.FormatInt(*editTimestamp, 10)) } + cmd = append(cmd, "--notify-self") + rawData, err := s.cliClient.Execute(true, cmd, message) if err != nil { cleanupAttachmentEntries(attachmentEntries)