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