Add support for downstream WHOIS nick/network nick/network
Many IRC clients use the query `WHOIS nick nick` rather than `WHOIS nick` when querying a nick. The former command means to specifically query the WHOIS on the server to which `nick` is connected, which is useful to get information that is sometimes not propagated between servers, such as idle time. In the case where a downstream sends WHOIS nick/network nick/network in multi-server mode, we need to unmarshal both fields. Previously, we did not unmarshal those fields, and upstreams would receive `WHOIS nick/network nick`, which is incorrect. This adds support for unmarshaling the target field if it is the same as the mask field, by simply using the unmarshaled nick that is already computed from the mask.
This commit is contained in:
parent
a64e1d6761
commit
791cf4b887
@ -1379,7 +1379,11 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error {
|
||||
|
||||
var params []string
|
||||
if target != "" {
|
||||
if target == mask { // WHOIS nick nick
|
||||
params = []string{upstreamNick, upstreamNick}
|
||||
} else {
|
||||
params = []string{target, upstreamNick}
|
||||
}
|
||||
} else {
|
||||
params = []string{upstreamNick}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user