~psic4t/qcard

b9cf16c091a496303927bef972f022e869f643bc — psic4t 3 months ago 3e0936d
fix email parsing
3 files changed, 6 insertions(+), 5 deletions(-)

M TODO
M parse.go
M qcard
M TODO => TODO +2 -1
@@ 1,4 1,5 @@
# TODO

- search by organisation
- Mutt integration
- sort by last name
- add contact from mutt

M parse.go => parse.go +4 -4
@@ 43,15 43,15 @@ func parseContactPhoneWork(contactData *string) string {
}

func parseContactEmailHome(contactData *string) string {
	re, _ := regexp.Compile(`(?i)EMAIL(;TYPE=(HOME|INTERNET))?:.*?\n`)
	re, _ := regexp.Compile(`(?i)EMAIL(;TYPE=(HOME|INTERNET|PREF|INTERNET,HOME))?:.*?\n`)
	result := re.FindString(*contactData)
	return trimField(result, "(?i)EMAIL(;TYPE=(HOME|INTERNET))?:")
	return trimField(result, "(?i)EMAIL(;TYPE=(HOME|INTERNET|PREF|INTERNET,HOME))?:")
}

func parseContactEmailWork(contactData *string) string {
	re, _ := regexp.Compile(`(?i)EMAIL;TYPE=WORK:.*?\n`)
	re, _ := regexp.Compile(`(?i)EMAIL;TYPE=(WORK|INTERNET,WORK):.*?\n`)
	result := re.FindString(*contactData)
	return trimField(result, "(?i)EMAIL;TYPE=WORK:")
	return trimField(result, "(?i)EMAIL;TYPE=(WORK|INTERNET,WORK):")
}

func parseContactAddressHome(contactData *string) string {

M qcard => qcard +0 -0