From 90d5f7d6a296b156d1ad1bab6733c0c8b9269f3f Mon Sep 17 00:00:00 2001 From: Daniel Oaks Date: Mon, 5 Sep 2016 19:43:32 +1000 Subject: [PATCH] registration: Very initial, very skodgy 'working' account reg --- irc/registration.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/irc/registration.go b/irc/registration.go index 0424cb8b..e4a267fb 100644 --- a/irc/registration.go +++ b/irc/registration.go @@ -120,6 +120,10 @@ func regCreateHandler(server *Server, client *Client, msg ircmsg.IrcMessage) boo // account could not be created and relevant numerics have been dispatched, abort if err != nil { + if err != errAccountCreation { + client.Send(nil, server.nameString, ERR_UNKNOWNERROR, client.nickString, "REG", "CREATE", "Could not register") + log.Println("Could not save registration initial data:", err.Error()) + } return false } @@ -221,14 +225,13 @@ func regCreateHandler(server *Server, client *Client, msg ircmsg.IrcMessage) boo } // automatically complete registration - if callbackNamespace != "*" { + if callbackNamespace == "*" { client.Notice("Account creation was successful!") - removeFailedRegCreateData(server.store, accountString) return false } // dispatch callback - client.Notice(fmt.Sprintf("We should dispatch an actual callback here to %s:%s", callbackNamespace, callbackValue)) + client.Notice(fmt.Sprintf("We should dispatch a real callback here to %s:%s", callbackNamespace, callbackValue)) return false }