mirror of
https://github.com/aljazceru/signal-cli-rest-api.git
synced 2025-12-29 20:44:29 +01:00
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
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user