diff --git a/downstream.go b/downstream.go index 0283358..45c4922 100644 --- a/downstream.go +++ b/downstream.go @@ -261,6 +261,19 @@ func (c *downstreamConn) handleMessageRegistered(msg *irc.Message) error { Command: irc.ERR_NOSUCHCHANNEL, Params: []string{name, "Channel name ambiguous"}, }} + case "PART": + var name string + if err := parseMessageParams(msg, &name); err != nil { + return err + } + + ch, err := c.user.getChannel(name) + if err != nil { + return err + } + + ch.conn.messages <- msg + // TODO: remove channel from upstream config case "MODE": var name string if err := parseMessageParams(msg, &name); err != nil { diff --git a/server.go b/server.go index ef5d4e5..dae434e 100644 --- a/server.go +++ b/server.go @@ -75,7 +75,10 @@ func (u *user) getChannel(name string) (*upstreamChannel, error) { } }) if channel == nil { - return nil, fmt.Errorf("unknown channel %q", name) + return nil, ircError{&irc.Message{ + Command: irc.ERR_NOSUCHCHANNEL, + Params: []string{name, "No such channel"}, + }} } return channel, nil }