]> Cypherpunks.ru repositories - goircd.git/commitdiff
Increase client compatibility - let Quassel IRC users join
authorBjörn Busse <mail@baerlin.eu>
Mon, 28 Sep 2015 04:22:17 +0000 (06:22 +0200)
committerBjörn Busse <mail@baerlin.eu>
Mon, 28 Sep 2015 04:22:17 +0000 (06:22 +0200)
Quassel prefixes the nickname in the NICK command with a colon.
This seems to be in accordance with rfc2812. Therefor check
if the first character of a nickname is a colon and remove it.

daemon.go

index 6b44039651032b54ef0e769416581b563983a3f9..7af810ca27196304a246de2966b74707a8daf8d5 100644 (file)
--- a/daemon.go
+++ b/daemon.go
@@ -180,6 +180,9 @@ func (daemon *Daemon) ClientRegister(client *Client, command string, cols []stri
                        return
                }
                nickname := cols[1]
                        return
                }
                nickname := cols[1]
+               if (strings.HasPrefix(nickname, ":")) {
+                       nickname = strings.TrimPrefix(nickname, ":")
+               }
                for existingClient := range daemon.clients {
                        if existingClient.nickname == nickname {
                                client.ReplyParts("433", "*", nickname, "Nickname is already in use")
                for existingClient := range daemon.clients {
                        if existingClient.nickname == nickname {
                                client.ReplyParts("433", "*", nickname, "Nickname is already in use")