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

Method Sanitize

api/pkg/requests/bulk_message_request.go:58–71  ·  view source on GitHub ↗

Sanitize sets defaults to BulkMessage

()

Source from the content-addressed store, hash-verified

56
57// Sanitize sets defaults to BulkMessage
58func (input *BulkMessage) Sanitize() *BulkMessage {
59 input.ToPhoneNumber = input.sanitizeAddress(input.ToPhoneNumber)
60 input.Content = strings.TrimSpace(input.Content)
61 input.FromPhoneNumber = input.sanitizeAddress(input.FromPhoneNumber)
62
63 var attachments []string
64 for _, attachment := range strings.Split(input.AttachmentURLs, ",") {
65 if strings.TrimSpace(attachment) != "" {
66 attachments = append(attachments, strings.TrimSpace(attachment))
67 }
68 }
69 input.AttachmentURLs = strings.Join(attachments, ",")
70 return input
71}
72
73// ToMessageSendParams converts BulkMessage to services.MessageSendParams
74func (input *BulkMessage) ToMessageSendParams(userID entities.UserID, requestID string, source string, index int, location *time.Location) services.MessageSendParams {

Callers

nothing calls this directly

Calls 1

sanitizeAddressMethod · 0.45

Tested by

no test coverage detected