Add pass to bouncer network attributes

This commit is contained in:
Simon Ser 2021-03-09 11:18:51 +01:00
parent db0f745193
commit 60c566e721
2 changed files with 5 additions and 0 deletions

View File

@ -220,6 +220,7 @@ Bouncers MUST recognise the following network attributes:
* `nickname`: the nickname to use during registration.
* `username`: the username to use during registration.
* `realname`: the realname to use during registration.
* `pass`: the server password (PASS) to use during registration.
TODO: more attributes

View File

@ -2040,6 +2040,7 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error {
username, _ := attrs.GetTag("username")
realname, _ := attrs.GetTag("realname")
pass, _ := attrs.GetTag("pass")
// TODO: reject unknown attributes
@ -2048,6 +2049,7 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error {
Nick: nick,
Username: username,
Realname: realname,
Pass: pass,
}
network, err := dc.user.createNetwork(record)
if err != nil {
@ -2092,6 +2094,8 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error {
record.Username = s
case "realname":
record.Realname = s
case "pass":
record.Pass = s
default:
return ircError{&irc.Message{
Command: "FAIL",