Esempio n. 1
0
        /// <summary>
        /// Received the full host for a userreply
        /// </summary>
        /// <param name="connection">Which Connection it came from</param>
        /// <param name="fullhost">The full user host Nick+=Ident@Host</param>
        private void OnUserHostReply(IRCConnection connection, string fullhost)
        {
            string host = fullhost.Substring(fullhost.IndexOf('+') + 1);
            string nick = "";
            if (fullhost.IndexOf('*') > -1)
                nick = fullhost.Substring(0, fullhost.IndexOf('*'));
            else
                nick = fullhost.Substring(0, fullhost.IndexOf('='));

            //update the internal addresslist and check for user in all channels
            InternalAddressList ial = new InternalAddressList(nick, host, "");

            if (!connection.ServerSetting.IAL.ContainsKey(nick))
                connection.ServerSetting.IAL.Add(nick, ial);
            else
                ((InternalAddressList)connection.ServerSetting.IAL[nick]).Host = host;
        }
Esempio n. 2
0
        private void OnIALUserData(IRCConnection connection, string nick, string host, string channel)
        {
            //internal addresslist userdata
            if (!connection.IsFullyConnected) return;
            if (connection.ServerSetting.StatusModes == null) return;

            for (int i = 0; i < connection.ServerSetting.StatusModes[1].Length; i++)
                nick = nick.Replace(connection.ServerSetting.StatusModes[1][i].ToString(), string.Empty);

            InternalAddressList ial = new InternalAddressList(nick, host, channel);
            if (!connection.ServerSetting.IAL.ContainsKey(nick))
            {
                connection.ServerSetting.IAL.Add(nick, ial);
            }
            else
            {
                if (channel.Length > 0)
                    ((InternalAddressList)connection.ServerSetting.IAL[nick]).AddChannel(channel);
                if (host.Length > 0)
                    ((InternalAddressList)connection.ServerSetting.IAL[nick]).Host = host;
            }
        }