Add support for read receipts on /receive

This commit is contained in:
Jonathan Neidel
2024-04-26 12:50:53 +02:00
parent 9d6f4a05a3
commit b23ee29b1f
3 changed files with 15 additions and 2 deletions

View File

@@ -720,7 +720,7 @@ func (s *SignalClient) SendV2(number string, message string, recps []string, bas
return &timestamps, nil
}
func (s *SignalClient) Receive(number string, timeout int64, ignoreAttachments bool, ignoreStories bool, maxMessages int64) (string, error) {
func (s *SignalClient) Receive(number string, timeout int64, ignoreAttachments bool, ignoreStories bool, maxMessages int64, sendReadReceipts bool) (string, error) {
if s.signalCliMode == JsonRpc {
return "", errors.New("Not implemented")
} else {
@@ -739,6 +739,10 @@ func (s *SignalClient) Receive(number string, timeout int64, ignoreAttachments b
command = append(command, strconv.FormatInt(maxMessages, 10))
}
if sendReadReceipts {
command = append(command, "--send-read-receipts")
}
out, err := s.cliClient.Execute(true, command, "")
if err != nil {
return "", err