public void Query(IrcIdentity ident, Action <WhoisData> callback) { if (ident.Username != null || ident.Hostname != null) { var data = new WhoisData(); data.Identity = ident; callback.Invoke(data); } else { QueryAccount(ident, callback); } }
private void QueryAccount(IrcIdentity ident, Action <WhoisData> callback) { WhoisData data; if (Pending.ContainsKey(ident.Nickname)) { data = Pending[ident.Nickname]; } else { data = new WhoisData(); Pending.Add(ident.Nickname, data); // TODO: create a timeout? } data.Callbacks.Add(callback); Bootstrap.Client.Client.Whois(ident.Nickname); }