MCPcopy Index your code
hub / github.com/NdoleStudio/httpsms / Sanitize

Method Sanitize

api/pkg/requests/message_bulk_send_request.go:32–49  ·  view source on GitHub ↗

Sanitize sets defaults to MessageReceive

()

Source from the content-addressed store, hash-verified

30
31// Sanitize sets defaults to MessageReceive
32func (input *MessageBulkSend) Sanitize() MessageBulkSend {
33 var to []string
34 for _, address := range input.To {
35 to = append(to, input.sanitizeAddress(address))
36 }
37
38 var attachments []string
39 for _, attachment := range input.Attachments {
40 if strings.TrimSpace(attachment) != "" {
41 attachments = append(attachments, strings.TrimSpace(attachment))
42 }
43 }
44
45 input.Attachments = attachments
46 input.To = to
47 input.From = input.sanitizeAddress(input.From)
48 return *input
49}
50
51// ToMessageSendParams converts MessageSend to services.MessageSendParams
52func (input *MessageBulkSend) ToMessageSendParams(userID entities.UserID, source string) []services.MessageSendParams {

Callers 1

BulkSendMethod · 0.95

Calls 1

sanitizeAddressMethod · 0.45

Tested by

no test coverage detected