Add support for account-notify
This commit is contained in:
parent
2f495e9768
commit
455fef2421
@ -131,6 +131,7 @@ var permanentDownstreamCaps = map[string]string{
|
||||
// needAllDownstreamCaps is the list of downstream capabilities that
|
||||
// require support from all upstreams to be enabled
|
||||
var needAllDownstreamCaps = map[string]string{
|
||||
"account-notify": "",
|
||||
"account-tag": "",
|
||||
"away-notify": "",
|
||||
"extended-join": "",
|
||||
@ -409,6 +410,9 @@ func (dc *downstreamConn) SendMessage(msg *irc.Message) {
|
||||
if msg.Command == "SETNAME" && !dc.caps["setname"] {
|
||||
return
|
||||
}
|
||||
if msg.Command == "ACCOUNT" && !dc.caps["account-notify"] {
|
||||
return
|
||||
}
|
||||
|
||||
dc.conn.SendMessage(msg)
|
||||
}
|
||||
|
12
upstream.go
12
upstream.go
@ -1386,6 +1386,18 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error {
|
||||
Params: msg.Params,
|
||||
})
|
||||
})
|
||||
case "ACCOUNT":
|
||||
if msg.Prefix == nil {
|
||||
return fmt.Errorf("expected a prefix")
|
||||
}
|
||||
|
||||
uc.forEachDownstream(func(dc *downstreamConn) {
|
||||
dc.SendMessage(&irc.Message{
|
||||
Prefix: dc.marshalUserPrefix(uc.network, msg.Prefix),
|
||||
Command: msg.Command,
|
||||
Params: msg.Params,
|
||||
})
|
||||
})
|
||||
case irc.RPL_BANLIST, irc.RPL_INVITELIST, irc.RPL_EXCEPTLIST:
|
||||
var channel, mask string
|
||||
if err := parseMessageParams(msg, nil, &channel, &mask); err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user