Skip to content

Commit dfdcfa3

Browse files
author
Bernhard B
committed
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
1 parent 8c9b797 commit dfdcfa3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/client/client.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,7 @@ func (s *SignalClient) send(number string, message string,
410410
QuoteMentions []string `json:"quote-mentions,omitempty"`
411411
TextStyles []string `json:"text-style,omitempty"`
412412
EditTimestamp *int64 `json:"edit-timestamp,omitempty"`
413+
NotifySelf bool `json:"notify-self,omitempty"`
413414
}
414415

415416
request := Request{Message: message}
@@ -422,6 +423,8 @@ func (s *SignalClient) send(number string, message string,
422423
request.Attachments = append(request.Attachments, attachmentEntry.toDataForSignal())
423424
}
424425

426+
request.NotifySelf = true
427+
425428
request.Sticker = sticker
426429
if mentions != nil {
427430
request.Mentions = make([]string, len(mentions))
@@ -518,6 +521,8 @@ func (s *SignalClient) send(number string, message string,
518521
cmd = append(cmd, strconv.FormatInt(*editTimestamp, 10))
519522
}
520523

524+
cmd = append(cmd, "--notify-self")
525+
521526
rawData, err := s.cliClient.Execute(true, cmd, message)
522527
if err != nil {
523528
cleanupAttachmentEntries(attachmentEntries)

0 commit comments

Comments
 (0)