Changed snake case variables to camel case

This commit is contained in:
Robin THONI
2022-11-07 17:18:38 +01:00
parent fce14ba049
commit e5bd4dd30a

View File

@@ -295,7 +295,7 @@ func (s *MessageMention) toString() string {
func (s *SignalClient) send(number string, message string, func (s *SignalClient) send(number string, message string,
recipients []string, base64Attachments []string, isGroup bool, mentions []MessageMention, recipients []string, base64Attachments []string, isGroup bool, mentions []MessageMention,
quote_timestamp *int64, quote_author *string, quote_message *string, quote_mentions []MessageMention) (*SendResponse, error) { quoteTimestamp *int64, quoteAuthor *string, quoteMessage *string, quoteMentions []MessageMention) (*SendResponse, error) {
var resp SendResponse var resp SendResponse
@@ -364,12 +364,12 @@ func (s *SignalClient) send(number string, message string,
} else { } else {
request.Mentions = nil request.Mentions = nil
} }
request.QuoteTimestamp = quote_timestamp request.QuoteTimestamp = quoteTimestamp
request.QuoteAuthor = quote_author request.QuoteAuthor = quoteAuthor
request.QuoteMessage = quote_message request.QuoteMessage = quoteMessage
if quote_mentions != nil { if quoteMentions != nil {
request.QuoteMentions = make([]string, len(quote_mentions)) request.QuoteMentions = make([]string, len(quoteMentions))
for i, mention := range quote_mentions { for i, mention := range quoteMentions {
request.QuoteMentions[i] = mention.toString() request.QuoteMentions[i] = mention.toString()
} }
} else { } else {
@@ -409,22 +409,22 @@ func (s *SignalClient) send(number string, message string,
cmd = append(cmd, mention.toString()) cmd = append(cmd, mention.toString())
} }
if quote_timestamp != nil { if quoteTimestamp != nil {
cmd = append(cmd, "--quote-timestamp") cmd = append(cmd, "--quote-timestamp")
cmd = append(cmd, strconv.FormatInt(*quote_timestamp, 10)) cmd = append(cmd, strconv.FormatInt(*quoteTimestamp, 10))
} }
if quote_author != nil { if quoteAuthor != nil {
cmd = append(cmd, "--quote-author") cmd = append(cmd, "--quote-author")
cmd = append(cmd, *quote_author) cmd = append(cmd, *quoteAuthor)
} }
if quote_message != nil { if quoteMessage != nil {
cmd = append(cmd, "--quote-message") cmd = append(cmd, "--quote-message")
cmd = append(cmd, *quote_message) cmd = append(cmd, *quoteMessage)
} }
for _, mention := range quote_mentions { for _, mention := range quoteMentions {
cmd = append(cmd, "--quote-mention") cmd = append(cmd, "--quote-mention")
cmd = append(cmd, mention.toString()) cmd = append(cmd, mention.toString())
} }
@@ -539,7 +539,7 @@ func (s *SignalClient) getJsonRpc2Clients() []*JsonRpc2Client {
} }
func (s *SignalClient) SendV2(number string, message string, recps []string, base64Attachments []string, mentions []MessageMention, func (s *SignalClient) SendV2(number string, message string, recps []string, base64Attachments []string, mentions []MessageMention,
quote_timestamp *int64, quote_author *string, quote_message *string, quote_mentions []MessageMention) (*[]SendResponse, error) { quoteTimestamp *int64, quoteAuthor *string, quoteMessage *string, quoteMentions []MessageMention) (*[]SendResponse, error) {
if len(recps) == 0 { if len(recps) == 0 {
return nil, errors.New("Please provide at least one recipient") return nil, errors.New("Please provide at least one recipient")
} }
@@ -569,7 +569,7 @@ func (s *SignalClient) SendV2(number string, message string, recps []string, bas
timestamps := []SendResponse{} timestamps := []SendResponse{}
for _, group := range groups { for _, group := range groups {
timestamp, err := s.send(number, message, []string{group}, base64Attachments, true, mentions, quote_timestamp, quote_author, quote_message, quote_mentions) timestamp, err := s.send(number, message, []string{group}, base64Attachments, true, mentions, quoteTimestamp, quoteAuthor, quoteMessage, quoteMentions)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@@ -577,7 +577,7 @@ func (s *SignalClient) SendV2(number string, message string, recps []string, bas
} }
if len(recipients) > 0 { if len(recipients) > 0 {
timestamp, err := s.send(number, message, recipients, base64Attachments, false, mentions, quote_timestamp, quote_author, quote_message, quote_mentions) timestamp, err := s.send(number, message, recipients, base64Attachments, false, mentions, quoteTimestamp, quoteAuthor, quoteMessage, quoteMentions)
if err != nil { if err != nil {
return nil, err return nil, err
} }