From 0ec3e63ace689c37c00b335e439bc6927920dc6f Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 23 Mar 2022 19:15:52 +0100 Subject: [PATCH] downstream: send RPL_ENDOFWHO on unmarshalEntity error Also remove a couple of outdated comments. --- downstream.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/downstream.go b/downstream.go index d56c316..49f6807 100644 --- a/downstream.go +++ b/downstream.go @@ -2203,13 +2203,8 @@ func (dc *downstreamConn) handleMessageRegistered(ctx context.Context, msg *irc. }) } } - // For WHOX docs, see: - // - http://faerion.sourceforge.net/doc/irc/whox.var - // - https://github.com/quakenet/snircd/blob/master/doc/readme.who - // Note, many features aren't widely implemented, such as flags and mask2 case "WHO": if len(msg.Params) == 0 { - // TODO: support WHO without parameters dc.SendMessage(&irc.Message{ Prefix: dc.srv.prefix(), Command: irc.RPL_ENDOFWHO, @@ -2296,7 +2291,14 @@ func (dc *downstreamConn) handleMessageRegistered(ctx context.Context, msg *irc. // TODO: properly support WHO masks uc, upstreamMask, err := dc.unmarshalEntity(mask) if err != nil { - return err + // Ignore the error here, because clients don't know how to deal + // with anything other than RPL_ENDOFWHO + dc.SendMessage(&irc.Message{ + Prefix: dc.srv.prefix(), + Command: irc.RPL_ENDOFWHO, + Params: []string{dc.nick, endOfWhoToken, "End of /WHO list"}, + }) + return nil } params := []string{upstreamMask}