Example #1
0
        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);
            }
        }
Example #2
0
        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);
        }