From 60c566e7217cb7a0dc2c4f89c056c79c8dadc7ef Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 9 Mar 2021 11:18:51 +0100 Subject: [PATCH] Add pass to bouncer network attributes --- doc/ext/bouncer-networks.md | 1 + downstream.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/doc/ext/bouncer-networks.md b/doc/ext/bouncer-networks.md index 5d76cbb..28f99db 100644 --- a/doc/ext/bouncer-networks.md +++ b/doc/ext/bouncer-networks.md @@ -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 diff --git a/downstream.go b/downstream.go index b7308f2..fcb4b47 100644 --- a/downstream.go +++ b/downstream.go @@ -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",