aboutsummaryrefslogtreecommitdiff
path: root/cmd_user.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2024-12-08 10:58:12 +0800
committerRunxi Yu <me@runxiyu.org>2024-12-08 10:58:12 +0800
commitc4d1135bf4d321dbed6ab3a94f87029e87f22a5d (patch)
tree4352b0da2d7ffb18485fa1157250ca74f4af434f /cmd_user.go
parentPong should return server name as 1st argument (diff)
downloadmeseircd-c4d1135bf4d321dbed6ab3a94f87029e87f22a5d.tar.gz
meseircd-c4d1135bf4d321dbed6ab3a94f87029e87f22a5d.tar.zst
meseircd-c4d1135bf4d321dbed6ab3a94f87029e87f22a5d.zip
USER: Don't allow reregistration
Diffstat (limited to 'cmd_user.go')
-rw-r--r--cmd_user.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/cmd_user.go b/cmd_user.go
index 99d9027..3db56c7 100644
--- a/cmd_user.go
+++ b/cmd_user.go
@@ -13,10 +13,14 @@ func handleClientUser(msg RMsg, client *Client) bool {
client.Send(MakeMsg(self, ERR_NEEDMOREPARAMS, "USER", "Not enough parameters"))
return true
}
- client.Ident = "~" + msg.Params[0]
- client.Gecos = msg.Params[3]
- if client.State == ClientStatePreRegistration {
+ switch (client.State) {
+ case ClientStatePreRegistration:
+ client.Ident = "~" + msg.Params[0]
+ client.Gecos = msg.Params[3]
client.checkRegistration()
+ case ClientStateRegistered:
+ client.Send(MakeMsg(self, ERR_ALREADYREGISTERED, client.Nick, "You may not reregister"))
+ case ClientStateRemote:
}
return true
}