Sanitize sets defaults to MessageReceive
()
| 30 | |
| 31 | // Sanitize sets defaults to MessageReceive |
| 32 | func (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 |
| 52 | func (input *MessageBulkSend) ToMessageSendParams(userID entities.UserID, source string) []services.MessageSendParams { |
no test coverage detected