Documentation
¶
Overview ¶
Package compose holds the compose window's logic, with no UI: the recipient fields' addresses, Send Later's choices, the attachment reminder and the links the editor keeps (docs/specs/compose-ui.md). Outgoing mail itself is internal/compose's.
Index ¶
- func AllowedLink(href string) bool
- func HTMLText(src string) string
- func HasAttachment(src string, attachments int) bool
- func MentionsAttachment(text string) bool
- func NeedsReminder(src, signatureHTML string, attachments int) bool
- func OwnText(src, signatureHTML string) string
- func ParseAddresses(text string) (addresses []api.Address, invalid []string)
- func RecipientPrefix(text string) (string, string)
- func Token(a api.Address) string
- func TomorrowMorning(now time.Time) time.Time
- func ValidAddress(text string) bool
- type Choice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllowedLink ¶ added in v0.10.0
AllowedLink reports whether the editor keeps a link.
func HTMLText ¶
HTMLText is the text of HTML: blocks and line breaks end a line, then white space is squashed.
func HasAttachment ¶
HasAttachment reports a chip, or an image outside every quote.
func MentionsAttachment ¶
MentionsAttachment reports whether text holds an attachment word as a whole word.
func NeedsReminder ¶
NeedsReminder reports whether the user's own text mentions an attachment and none is attached.
func OwnText ¶
OwnText is the text the user wrote: no quotes, no attribution line, no signature (docs/specs/compose-ui.md, Attachment reminder).
func ParseAddresses ¶
ParseAddresses splits typed or pasted text into addresses, dropping repeats without regard to case; pieces that do not parse come back as invalid, trimmed.
func RecipientPrefix ¶ added in v0.10.0
RecipientPrefix returns the completed part of a field, including its last separator, and the last unfinished address for completion.
func Token ¶
Token writes an address as a recipient field's token, which reads back as this one recipient whatever the mail it came from says: the text is untrusted. An address that cannot be written plainly becomes one quoted piece, which is invalid and holds the send back.
func TomorrowMorning ¶
TomorrowMorning is where the Send Later sheet starts.
func ValidAddress ¶
ValidAddress reports whether text is a plausible email address.