Handle downstream PART messages
This commit is contained in:
parent
09a793ff9c
commit
69a35069ef
@ -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 {
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user