| 1 |
package backend |
| 2 |
|
| 3 |
import ( |
| 4 |
"github.com/ProtonMail/gluon/rfc822" |
| 5 |
"github.com/henrybear327/go-proton-api" |
| 6 |
) |
| 7 |
|
| 8 |
type mailSettings struct { |
| 9 |
displayName string |
| 10 |
draftMIMEType rfc822.MIMEType |
| 11 |
attachPubKey bool |
| 12 |
} |
| 13 |
|
| 14 |
func newMailSettings(displayName string) *mailSettings { |
| 15 |
return &mailSettings{ |
| 16 |
displayName: displayName, |
| 17 |
attachPubKey: false, |
| 18 |
} |
| 19 |
} |
| 20 |
|
| 21 |
func (settings *mailSettings) toMailSettings() proton.MailSettings { |
| 22 |
return proton.MailSettings{ |
| 23 |
DisplayName: settings.displayName, |
| 24 |
DraftMIMEType: settings.draftMIMEType, |
| 25 |
AttachPublicKey: proton.Bool(settings.attachPubKey), |
| 26 |
} |
| 27 |
} |