summaryrefslogtreecommitdiffstats
path: root/model
diff options
context:
space:
mode:
authorDaniel Schalla <daniel@schalla.me>2018-07-09 12:45:48 +0200
committerGeorge Goldberg <george@gberg.me>2018-07-09 11:45:48 +0100
commite8b8ef394b0bfb9a0798f43e282804c6b29390f8 (patch)
tree2cb1355ceaf7974afcf2bb9590da4d6b0e9adb1f /model
parent9e5ec7d09d4c51e278f17f25fb6c0f3484b50a3b (diff)
downloadchat-e8b8ef394b0bfb9a0798f43e282804c6b29390f8.tar.gz
chat-e8b8ef394b0bfb9a0798f43e282804c6b29390f8.tar.bz2
chat-e8b8ef394b0bfb9a0798f43e282804c6b29390f8.zip
Blacklist System as Username (#9060)
adapted tests
Diffstat (limited to 'model')
-rw-r--r--model/user.go1
-rw-r--r--model/user_test.go1
2 files changed, 2 insertions, 0 deletions
diff --git a/model/user.go b/model/user.go
index c5d6c13b6..e56f3aaed 100644
--- a/model/user.go
+++ b/model/user.go
@@ -565,6 +565,7 @@ var restrictedUsernames = []string{
"all",
"channel",
"matterbot",
+ "system",
}
func IsValidUsername(s string) bool {
diff --git a/model/user_test.go b/model/user_test.go
index 645eaadff..a1953a40d 100644
--- a/model/user_test.go
+++ b/model/user_test.go
@@ -272,6 +272,7 @@ var usernames = []struct {
{"spin'punch", false},
{"spin*punch", false},
{"all", false},
+ {"system", false},
}
func TestValidUsername(t *testing.T) {