From 3f2e08b949ce9951e067b331f245e41f8b838694 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 6 Feb 2020 21:43:22 +0100 Subject: [PATCH] Mark channel info as complete on RPL_ENDOFNAMES --- upstream.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/upstream.go b/upstream.go index 10e0f2b..a65c0ab 100644 --- a/upstream.go +++ b/upstream.go @@ -19,6 +19,7 @@ type upstreamChannel struct { TopicTime time.Time Status channelStatus Members map[string]membership + complete bool } type upstreamConn struct { @@ -158,7 +159,15 @@ func (c *upstreamConn) handleMessage(msg *irc.Message) error { ch.Members[nick] = membership } case irc.RPL_ENDOFNAMES: - // TODO + if len(msg.Params) < 2 { + return newNeedMoreParamsError(msg.Command) + } + ch, err := c.getChannel(msg.Params[1]) + if err != nil { + return err + } + + ch.complete = true case irc.RPL_YOURHOST, irc.RPL_CREATED: // Ignore case irc.RPL_LUSERCLIENT, irc.RPL_LUSEROP, irc.RPL_LUSERUNKNOWN, irc.RPL_LUSERCHANNELS, irc.RPL_LUSERME: