activate endpoint and write swagger documentation

This commit is contained in:
René Filip
2021-11-06 00:43:02 +01:00
parent 6bf60a23e6
commit 3bd0d97970
6 changed files with 490 additions and 321 deletions

View File

@@ -1008,6 +1008,9 @@ func (s *SignalClient) SendReaction(number string, recipient string, emoji strin
return errors.New("Invalid group id")
}
}
if remove && emoji == "" {
emoji = "👍" // emoji must not be empty to remove a reaction
}
if s.signalCliMode == JsonRpc {
type Request struct {
@@ -1027,7 +1030,7 @@ func (s *SignalClient) SendReaction(number string, recipient string, emoji strin
request.Emoji = emoji
request.TargetAuthor = target_author
request.Timestamp = timestamp
if remove == true {
if remove {
request.Remove = remove
}
jsonRpc2Client, err := s.getJsonRpc2Client(number)