summaryrefslogtreecommitdiffstats
path: root/model/utils.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-07-08 11:50:10 -0400
committerChristopher Speller <crspeller@gmail.com>2015-07-20 17:45:23 -0400
commitc6fb95912bb481791c1ca370a46a4da9c05d05ad (patch)
treebb33ff7b494b45c9d95c15f290d97914e911ce91 /model/utils.go
parenta1876cf6cc827743d8687a9113b727ef7190f452 (diff)
downloadchat-c6fb95912bb481791c1ca370a46a4da9c05d05ad.tar.gz
chat-c6fb95912bb481791c1ca370a46a4da9c05d05ad.tar.bz2
chat-c6fb95912bb481791c1ca370a46a4da9c05d05ad.zip
Changing the way we mattermost handles URLs. team.domain.com becomes domain.com/team.
Renaming team.Name to team.DisplayName and team.Domain to team.Name. So: team.Name -> url safe name. team.DisplayName -> nice name for users
Diffstat (limited to 'model/utils.go')
-rw-r--r--model/utils.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/model/utils.go b/model/utils.go
index 465901a09..38592b984 100644
--- a/model/utils.go
+++ b/model/utils.go
@@ -148,7 +148,7 @@ func IsValidEmail(email string) bool {
return false
}
-var reservedDomains = []string{
+var reservedName = []string{
"www",
"web",
"admin",
@@ -168,10 +168,10 @@ var reservedDomains = []string{
"api",
}
-func IsReservedDomain(s string) bool {
+func IsReservedTeamName(s string) bool {
s = strings.ToLower(s)
- for _, value := range reservedDomains {
+ for _, value := range reservedName {
if strings.Index(s, value) == 0 {
return true
}
@@ -180,7 +180,7 @@ func IsReservedDomain(s string) bool {
return false
}
-func IsValidDomain(s string) bool {
+func IsValidTeamName(s string) bool {
if !IsValidAlphaNum(s) {
return false