Esempio n. 1
0
 /// <summary>
 /// �T�[�o�[���b�Z�[�W��M
 /// </summary>
 private void ircClient_ReceiveServerReply(object sender, EbiSoft.EbIRC.IRC.ReceiveServerReplyEventArgs e)
 {
     AddLog(m_serverCh,
             string.Format(Resources.NumericReplyLogFormat, (int) e.Number, string.Join(" ", e.Parameter) )
     );
 }
Esempio n. 2
0
 /// <summary>
 /// ���[�U�[�̏o����
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void ircClient_UserInOut(object sender, EbiSoft.EbIRC.IRC.UserInOutEventArgs e)
 {
     // �����̂Ƃ�
     if (e.User == ircClient.UserString)
     {
         switch (e.Command)
         {
             case InOutCommands.Join:
                 // ���݂��Ȃ��`�����l���̂Ƃ��͒lj�
                 if ((e.Channel != string.Empty)
                     && !m_channel.ContainsKey(e.Channel))
                 {
                     AddChannel(e.Channel, false, null, true);
                 }
                 // �Q���t���O�ύX
                 m_channel[e.Channel].IsJoin = true;
                 // ���O�lj�
                 AddLog(m_channel[e.Channel], string.Format(Resources.Joined, IRCClient.GetUserName(e.User)));
                 break;
             case InOutCommands.Leave:
                 if (m_channel.ContainsKey(e.Channel))
                 {
                     // �Q���t���O�ύX
                     m_channel[e.Channel].IsJoin = false;
                     // ���O�lj�
                     AddLog(m_channel[e.Channel], string.Format(Resources.Leaved, IRCClient.GetUserName(e.User)));
                 }
                 break;
         }
     }
     // ���l�̂Ƃ�
     else
     {
         List<string> list;
         switch (e.Command)
         {
             case InOutCommands.Join:
                 list = new List<string>(m_channel[e.Channel].Members);
                 // �`�����l���ɖ��O��lj�����
                 list.Add(IRCClient.GetUserName(e.User));
                 m_channel[e.Channel].Members = list.ToArray();
                 // ���݂̃`�����l����������A�t�H�[���̏�Ԃ�X�V����
                 if (m_currentCh == m_channel[e.Channel])
                     LoadChannel(m_currentCh);
                 // ���O�lj�
                 AddLog(m_channel[e.Channel], string.Format(Resources.JoinedUser, IRCClient.GetUserName(e.User)));
                 break;
             case InOutCommands.Leave:
                 list = new List<string>(m_channel[e.Channel].Members);
                 // �`�����l�����疼�O��폜����
                 list.Remove(IRCClient.GetUserName(e.User));
                 list.Remove("@" + IRCClient.GetUserName(e.User));
                 m_channel[e.Channel].Members = list.ToArray();
                 // ���݂̃`�����l����������A�t�H�[���̏�Ԃ�X�V����
                 if (m_currentCh == m_channel[e.Channel])
                     LoadChannel(m_currentCh);
                 // ���O�lj�
                 AddLog(m_channel[e.Channel], string.Format(Resources.LeavedUser, IRCClient.GetUserName(e.User)));
                 break;
             case InOutCommands.Quit:
                 // �S�`�����l���ɂ‚���
                 foreach (Channel ch in m_channel.Values)
                 {
                     list = new List<string>(ch.Members);
                     // �����‚������
                     if (list.Contains(IRCClient.GetUserName(e.User))
                         || list.Contains("@" + IRCClient.GetUserName(e.User)))
                     {
                         // �`�����l�����疼�O��폜����
                         list.Remove(IRCClient.GetUserName(e.User));
                         list.Remove("@" + IRCClient.GetUserName(e.User));
                         ch.Members = list.ToArray();
                         // ���݂̃`�����l����������A�t�H�[���̏�Ԃ�X�V����
                         if (m_currentCh == ch)
                             LoadChannel(m_currentCh);
                         // ���O�lj�
                         AddLog(ch, string.Format(Resources.DisconnectedUser, IRCClient.GetUserName(e.User)));
                     }
                 }
                 break;
         }
     }
 }
Esempio n. 3
0
        /// <summary>
        /// Notice ��M
        /// </summary>
        private void ircClient_ReceiveNotice(object sender, EbiSoft.EbIRC.IRC.ReceiveMessageEventArgs e)
        {
            // privmsg �Ή�
            string channel;
            if (IRCClient.IsChannelString(e.Receiver))
            {
                channel = e.Receiver;
            }
            else
            {
                if (IRCClient.GetUserName(e.Sender) == ircClient.User.NickName)
                {
                    channel = IRCClient.GetUserName(e.Receiver);
                }
                else
                {
                    channel = IRCClient.GetUserName(e.Sender);
                }
            }

            // ���M�҂��Z�b�g����Ă���ꍇ
            if (channel != string.Empty)
            {
                // ���݂��Ȃ��`�����l���̂Ƃ��͒lj�
                if (!m_channel.ContainsKey(channel))
                {
                    AddChannel(channel, false, null, true);
                    m_channel[channel].IsJoin = true;
                    return;
                }

                // �����L�[���[�h�t�B���^
                if ((dislikeMatcher != null) && dislikeMatcher.Match(e.Message).Success)
                    return;

                // �n�C���C�g�L�[���[�h�t�B���^
                //if ((highlightMatcher != null) && highlightMatcher.Match(e.Message).Success)
                //    SetHighlight(m_channel[channel]);

                // ���O�lj�
                AddLog(m_channel[channel], string.Format(Resources.NoticeLogFormat, IRCClient.GetUserName(e.Sender), e.Message));

                // Whole �ɒlj�����
                AddLog(m_wholeCh, string.Format(Resources.WholeNoticeLogFormat, channel, IRCClient.GetUserName(e.Sender), e.Message));
            }
            // �T�[�o�[�̂Ƃ�
            else
            {
                // ���O�lj�
                AddLog(m_serverCh, string.Format(Resources.NoticeLogFormat, IRCClient.GetUserName(e.Sender), e.Message));
            }
        }
Esempio n. 4
0
        /// <summary>
        /// ���O�ꗗ�̎�M
        /// </summary>
        private void ircClient_ReceiveNames(object sender, EbiSoft.EbIRC.IRC.ReceiveNamesEventArgs e)
        {
            // �`�����l���̂Ƃ�
            if (IRCClient.IsChannelString(e.Channel))
            {
                // ���݂��Ȃ��`�����l���̂Ƃ��͒lj�
                if (!m_channel.ContainsKey(e.Channel))
                {
                    AddChannel(e.Channel, false, null, true);
                    m_channel[e.Channel].IsJoin = true;
                }

                // ���O�lj�
                AddLog(m_channel[e.Channel], string.Format(Resources.UsersLogFormat, string.Join(", ", e.Names)));

                // ���O�ꗗ�X�V
                m_channel[e.Channel].Members = e.Names;
                // ���݂̃`�����l����������A�t�H�[���̏�Ԃ�X�V����
                if (m_currentCh == m_channel[e.Channel])
                    LoadChannel(m_currentCh);
            }
        }
Esempio n. 5
0
        /// <summary>
        /// ���b�Z�[�W��M
        /// </summary>
        private void ircClient_ReceiveMessage(object sender, EbiSoft.EbIRC.IRC.ReceiveMessageEventArgs e)
        {
            // privmsg �Ή�
            string channel;
            if (IRCClient.IsChannelString(e.Receiver))
            {
                channel = e.Receiver;
            }
            else
            {
                if (IRCClient.GetUserName(e.Sender) == ircClient.User.NickName)
                {
                    channel = IRCClient.GetUserName(e.Receiver);
                }
                else
                {
                    channel = IRCClient.GetUserName(e.Sender);
                }
            }

            // ���݂��Ȃ��`�����l���̂Ƃ��͒lj�
            if (!m_channel.ContainsKey(channel))
            {
                AddChannel(channel, false, null, true);
                m_channel[channel].IsJoin = true;
            }

            // �����L�[���[�h�t�B���^
            if ((dislikeMatcher != null) && dislikeMatcher.Match(e.Message).Success)
                return;

            // ���O�lj�
            string message = AddLog(m_channel[channel], string.Format(Resources.PrivmsgLogFormat, IRCClient.GetUserName(e.Sender), e.Message));

            // ���������Z
            if (m_channel[channel] != m_currentCh)
            {
                m_channel[channel].UnreadCount++;
            }

            // Whole �ɒlj�����
            AddLog(m_wholeCh, string.Format(Resources.WholePrivmsgLogFormat, channel, IRCClient.GetUserName(e.Sender), e.Message));

            // �n�C���C�g�L�[���[�h�t�B���^
            if ((highlightMatcher != null) && highlightMatcher.Match(e.Message).Success)
                SetHighlight(m_channel[channel], IRCClient.GetUserName(e.Sender), e.Message);
        }
Esempio n. 6
0
 /// <summary>
 /// CTCP���v���C��M�����Ƃ�
 /// </summary>
 private void ircClient_ReceiveCtcpReply(object sender, EbiSoft.EbIRC.IRC.CtcpEventArgs e)
 {
     AddLog(m_serverCh, string.Format(Resources.CtcpReplyMessage, IRCClient.GetUserName(e.Sender), e.Command, e.Reply));
 }
Esempio n. 7
0
        /// <summary>
        /// �R��ꂽ�Ƃ�
        /// </summary>
        private void ircClient_Kick(object sender, EbiSoft.EbIRC.IRC.KickEventArgs e)
        {
            // ���݂��Ȃ��`�����l���̂Ƃ��͒lj�
            if (!m_channel.ContainsKey(e.Channel))
            {
                /*
                ���Ȃ��Ȃ�񂾂��炷��K�v�Ȃ�
                AddChannel(e.Channel, false);
                m_channel[e.Channel].IsJoin = true;
                */
                return;
            }

            // ���O�lj�
            AddLog(m_channel[e.Channel], string.Format(Resources.KickedMessage, e.User, e.Target));

            // �R��ꂽ�̂������̂Ƃ�
            if (e.Target == ircClient.User.NickName)
            {
                // �ގ�����
                m_channel[e.Channel].IsJoin = false;
                AddLog(m_channel[e.Channel], Resources.KickedMeMessage);
                // ���݂̃`�����l����������A�t�H�[���̏�Ԃ�X�V����
                if (m_currentCh == m_channel[e.Channel])
                    LoadChannel(m_currentCh);
            }
            // �R��ꂽ�̂����l�̂Ƃ�
            else
            {
                List<string> list = new List<string>(m_channel[e.Channel].Members);
                // �`�����l�����疼�O��폜����
                list.Remove(e.Target);
                list.Remove("@" + e.Target);
                m_channel[e.Channel].Members = list.ToArray();
                // ���݂̃`�����l����������A�t�H�[���̏�Ԃ�X�V����
                if (m_currentCh == m_channel[e.Channel])
                    LoadChannel(m_currentCh);
            }
        }