Changeset 299 in code for trunk/downstream.go


Ignore:
Timestamp:
May 27, 2020, 9:44:38 PM (5 years ago)
Author:
delthas
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/downstream.go

    r298 r299  
    13801380                var params []string
    13811381                if target != "" {
    1382                         params = []string{target, upstreamNick}
     1382                        if target == mask { // WHOIS nick nick
     1383                                params = []string{upstreamNick, upstreamNick}
     1384                        } else {
     1385                                params = []string{target, upstreamNick}
     1386                        }
    13831387                } else {
    13841388                        params = []string{upstreamNick}
Note: See TracChangeset for help on using the changeset viewer.