Fully working email feature

This commit is contained in:
Philipp Heckel 2021-12-25 00:13:09 +01:00
parent f553cdb282
commit 11b5ac49c0
7 changed files with 259 additions and 15 deletions

View file

@ -134,6 +134,26 @@ func ParsePriority(priority string) (int, error) {
}
}
// PriorityString converts a priority number to a string
func PriorityString(priority int) (string, error) {
switch priority {
case 0:
return "default", nil
case 1:
return "min", nil
case 2:
return "low", nil
case 3:
return "default", nil
case 4:
return "high", nil
case 5:
return "urgent", nil
default:
return "", errInvalidPriority
}
}
// ExpandHome replaces "~" with the user's home directory
func ExpandHome(path string) string {
return os.ExpandEnv(strings.ReplaceAll(path, "~", "$HOME"))