~emersion/public-inbox

soju: Send the full user mask in RPL_LOGGEDIN v1 NEEDS REVISION

Hubert Hirtz: 1
 Send the full user mask in RPL_LOGGEDIN

 1 files changed, 2 insertions(+), 1 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~emersion/public-inbox/patches/10868/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH soju] Send the full user mask in RPL_LOGGEDIN Export this patch

As per the spec at https://ircv3.net/specs/extensions/sasl-3.1

:server 900 <nick> <nick>!<ident>@<host> <account> :Now logged in
---
 downstream.go | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/downstream.go b/downstream.go
index d80ced5..40683d3 100644
--- a/downstream.go
+++ b/downstream.go
@@ -413,10 +413,11 @@ func (dc *downstreamConn) handleMessageUnregistered(msg *irc.Message) error {
			return fmt.Errorf("SASL authentication failed: %v", err)
		} else if done {
			dc.saslServer = nil
			fullMask := fmt.Sprintf("%s!%s@%s", dc.nick, dc.rawUsername, dc.hostname)
			dc.SendMessage(&irc.Message{
				Prefix:  dc.srv.prefix(),
				Command: irc.RPL_LOGGEDIN,
				Params:  []string{dc.nick, dc.nick, dc.user.Username, "You are now logged in"},
				Params:  []string{dc.nick, fullMask, dc.user.Username, "You are now logged in"},
			})
			dc.SendMessage(&irc.Message{
				Prefix:  dc.srv.prefix(),
-- 
2.26.2
Can we use irc.Prefix here instead of manually formatting the mask? We
already have a function that returns the downstream user's prefix, so
this should work:

    dc.prefix().String()