예제 #1
0
        private void IrcTopicChanged(string[] ircCommand)
        {
            string ircChannel = ircCommand[2];
            string ircUser    = ircCommand[0].Split('!')[0];

            if (!ChannelsIn.Contains(ircChannel))
            {
                ChannelsIn.Add(ircChannel);
            }

            string ircTopic = "";

            for (int intI = 4; intI < ircCommand.Length; intI++)
            {
                ircTopic += ircCommand[intI] + " ";
            }
            if (TopicChanged != null)
            {
                try
                {
                    TopicChanged(ircUser, ircChannel, ircTopic.Remove(0, 1).Trim());
                }
                catch (ArgumentException)
                {
                    //TODO: figure out why this error happens.
                }
            }
        }
예제 #2
0
        public void LeaveChannel(string channel)
        {
            var channels = channel.Split(',');

            foreach (var chan in channels)
            {
                if (ChannelsIn.Contains(chan))
                {
                    ChannelsIn.Remove(chan);
                }

                SendCommand(String.Format("PART {0}", chan));
            }
        }
예제 #3
0
        private void IrcPart(string[] ircCommand)
        {
            string ircChannel = ircCommand[2];
            string ircUser    = ircCommand[0].Split('!')[0];

            if (ircUser == Nick && ChannelsIn.Contains(ircChannel))
            {
                ChannelsIn.Remove(ircChannel);
            }

            if (Part != null)
            {
                Part(ircChannel, ircUser);
            }
        }
예제 #4
0
        private void IrcTopic(string[] ircCommand)
        {
            string ircChannel = ircCommand[3];

            if (!ChannelsIn.Contains(ircChannel))
            {
                ChannelsIn.Add(ircChannel);
            }

            string ircTopic = "";

            for (int intI = 4; intI < ircCommand.Length; intI++)
            {
                ircTopic += ircCommand[intI] + " ";
            }
            if (TopicSet != null)
            {
                TopicSet(ircChannel, ircTopic.Remove(0, 1).Trim());
            }
        }
예제 #5
0
        private void IrcKick(string[] ircCommand)
        {
            string userKicker  = ircCommand[0].Split('!')[0];
            string userKicked  = ircCommand[3];
            string ircChannel  = ircCommand[2];
            string kickMessage = "";

            if (userKicked == Nick && ChannelsIn.Contains(ircChannel))
            {
                ChannelsIn.Remove(ircChannel);
            }

            for (int intI = 4; intI < ircCommand.Length; intI++)
            {
                kickMessage += ircCommand[intI] + " ";
            }
            if (Kick != null)
            {
                Kick(ircChannel, userKicker, userKicked, kickMessage.Remove(0, 1).Trim());
            }
        }