mirror of
https://github.com/bbernhard/signal-cli-rest-api.git
synced 2026-05-25 14:34:22 +00: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:
parent
8c9b797026
commit
dfdcfa3725
@ -410,6 +410,7 @@ func (s *SignalClient) send(number string, message string,
|
|||||||
QuoteMentions []string `json:"quote-mentions,omitempty"`
|
QuoteMentions []string `json:"quote-mentions,omitempty"`
|
||||||
TextStyles []string `json:"text-style,omitempty"`
|
TextStyles []string `json:"text-style,omitempty"`
|
||||||
EditTimestamp *int64 `json:"edit-timestamp,omitempty"`
|
EditTimestamp *int64 `json:"edit-timestamp,omitempty"`
|
||||||
|
NotifySelf bool `json:"notify-self,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
request := Request{Message: message}
|
request := Request{Message: message}
|
||||||
@ -422,6 +423,8 @@ func (s *SignalClient) send(number string, message string,
|
|||||||
request.Attachments = append(request.Attachments, attachmentEntry.toDataForSignal())
|
request.Attachments = append(request.Attachments, attachmentEntry.toDataForSignal())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
request.NotifySelf = true
|
||||||
|
|
||||||
request.Sticker = sticker
|
request.Sticker = sticker
|
||||||
if mentions != nil {
|
if mentions != nil {
|
||||||
request.Mentions = make([]string, len(mentions))
|
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, strconv.FormatInt(*editTimestamp, 10))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cmd = append(cmd, "--notify-self")
|
||||||
|
|
||||||
rawData, err := s.cliClient.Execute(true, cmd, message)
|
rawData, err := s.cliClient.Execute(true, cmd, message)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
cleanupAttachmentEntries(attachmentEntries)
|
cleanupAttachmentEntries(attachmentEntries)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user