Beispiel #1
0
 private void session_RawMessageReceived(object sender, IrcEventArgs e)
 {
     if (e.Message.Command == "PRIVMSG" && e.Message.Parameters.Count == 2 &&
         (!CtcpCommand.IsCtcpCommand(e.Message.Parameters[1]) ||
          CtcpCommand.Parse(e.Message.Parameters[1]).Command == "ACTION"))
     {
         var target = new IrcTarget(e.Message.Parameters[0]);
         if (App.IsIgnoreMatch(e.Message.From, target.IsChannel ? IgnoreActions.Channel : IgnoreActions.Private))
         {
             return;
         }
         if (!target.IsChannel && e.Message.From is IrcPeer)
         {
             if (App.Create(sender as IrcSession, new IrcTarget((IrcPeer)e.Message.From), false) &&
                 _notifyIcon != null && _notifyIcon.IsVisible)
             {
                 _notifyIcon.Show("IRC Message", string.Format("You received a message from {0}.", ((IrcPeer)e.Message.From).Nickname));
             }
         }
         else if (_notifyIcon != null && _notifyIcon.IsVisible && e.Message.From is IrcPeer)
         {
             var title = String.Format("{0} : {1}", e.Message.Parameters[0], ((IrcPeer)e.Message.From).Nickname);
             _notifyIcon.Show(title, e.Message.Parameters[1]);
         }
     }
 }
Beispiel #2
0
 internal CtcpEventArgs(IrcMessage message)
     : base(message)
 {
     From       = message.From as IrcPeer;
     To         = message.Parameters.Count > 0 ? new IrcTarget(message.Parameters[0]) : null;
     Command    = message.Parameters.Count > 1 ? CtcpCommand.Parse(message.Parameters[1]) : null;
     IsResponse = message.Command == "NOTICE";
 }