Exemplo n.º 1
0
        public virtual void ResolveAuth(IrcUser user, IrcUserAuthResolvedHandler authResolvedHandler)
        {
            if (pendingQueries.ContainsKey(user.UserName))
            {
                // already querying
                return;
            }

            IrcUserAuthQuery query = null;

            IrcProtocol.PacketHandler handler = packet => {
                var authName = OnAuthPacketReceived(user, packet);
                if (authName != null)
                {
                    user.AuthName = authName;
                    RemoveQuery(query);
                    authResolvedHandler(user);
                }
            };

            IrcProtocol.Instance.AddPacketHandler(AuthOpcode, handler);

            pendingQueries[user.UserName] = query = new IrcUserAuthQuery(user, handler);

            user.IrcClient.CommandHandler.Whois(user.Nick);
        }
Exemplo n.º 2
0
        internal bool ResolveAuth(IrcUser user, IrcUserAuthResolvedHandler callback)
        {
            if (Authenticator == null)
            {
                // No Authenticator => Cannot resolve
                return(false);
            }
            else
            {
                Authenticator.ResolveAuth(user, userArg =>
                {
                    OnAuthResolved(userArg);

                    if (callback != null)
                    {
                        callback(user);
                    }
                });
                return(true);
            }
        }
Exemplo n.º 3
0
        internal bool ResolveAuth(IrcUser user, IrcUserAuthResolvedHandler callback)
        {
            if (Authenticator == null)
            {
                // No Authenticator => Cannot resolve
                return false;
            }
            else
            {
                Authenticator.ResolveAuth(user, userArg =>
                {
                    OnAuthResolved(userArg);

                    if (callback != null)
                    {
                        callback(user);
                    }
                });
                return true;
            }
        }
 public override void ResolveAuth(IrcUser user, IrcUserAuthResolvedHandler authResolvedHandler)
 {
     user.IrcClient.CommandHandler.Whois(user.Nick);
     base.ResolveAuth(user, authResolvedHandler);
 }
        public virtual void ResolveAuth(IrcUser user, IrcUserAuthResolvedHandler authResolvedHandler)
        {
            if (pendingQueries.ContainsKey(user.UserName))
            {
                // already querying
                return;
            }

            IrcUserAuthQuery query = null;
            IrcProtocol.PacketHandler handler = packet => {
                var authName = OnAuthPacketReceived(user, packet);
                if (authName != null)
                {
                    user.AuthName = authName;
                    RemoveQuery(query);
                    authResolvedHandler(user);
                }
            };

            IrcProtocol.Instance.AddPacketHandler(AuthOpcode, handler);

            pendingQueries[user.UserName] = query = new IrcUserAuthQuery(user, handler);

            user.IrcClient.CommandHandler.Whois(user.Nick);
        }
Exemplo n.º 6
0
 /// <summary>
 /// Initiates Authentication resolving.
 /// Only works if the authentication method of the current network is supported.
 /// Many authentication methods require querying the server. Once the query
 /// is completed, auth is resolved (or fails to resolve) and the
 /// <see cref="AuthenticationMgr.AuthResolved"/> event will be triggered.
 /// </summary>
 /// <param name="callback">Is called after authentication was resolved.</param>
 /// <returns>Whether the authentication query started successfully</returns>
 public bool ResolveAuthentication(IrcUserAuthResolvedHandler callback = null)
 {
     return(m_irc.AuthMgr.ResolveAuth(this, callback));
 }
Exemplo n.º 7
0
 /// <summary>
 /// Initiates Authentication resolving.
 /// Only works if the authentication method of the current network is supported.
 /// Many authentication methods require querying the server. Once the query
 /// is completed, auth is resolved (or fails to resolve) and the
 /// <see cref="AuthenticationMgr.AuthResolved"/> event will be triggered.
 /// </summary>
 /// <param name="callback">Is called after authentication was resolved.</param>
 /// <returns>Whether the authentication query started successfully</returns>
 public bool ResolveAuthentication(IrcUserAuthResolvedHandler callback = null)
 {
     return m_irc.AuthMgr.ResolveAuth(this, callback);
 }
 public override void ResolveAuth(IrcUser user, IrcUserAuthResolvedHandler authResolvedHandler)
 {
     user.IrcClient.CommandHandler.Whois(user.Nick);
     base.ResolveAuth(user, authResolvedHandler);
 }