bugfixes; email parsing; send emails into matrix rooms; e2e tests
This commit is contained in:
15
utils/utils.go
Normal file
15
utils/utils.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package utils
|
||||
|
||||
import "strings"
|
||||
|
||||
func Mailbox(email string) string {
|
||||
index := strings.LastIndex(email, "@")
|
||||
if index == -1 {
|
||||
return email
|
||||
}
|
||||
return email[:strings.LastIndex(email, "@")]
|
||||
}
|
||||
|
||||
func Hostname(email string) string {
|
||||
return email[strings.LastIndex(email, "@")+1:]
|
||||
}
|
||||
Reference in New Issue
Block a user