Inheritance: Squishy.Irc.Dcc.DccClient
Ejemplo n.º 1
0
 internal void ChatClosedNotify(DccChatClient client)
 {
     if (ChatClosed != null)
     {
         ChatClosed(client);
     }
 }
Ejemplo n.º 2
0
 internal void ChatFailedNotify(DccChatClient client, Exception ex)
 {
     if (ChatFailed != null)
     {
         ChatFailed(client, ex);
     }
 }
Ejemplo n.º 3
0
 internal void ChatEstablishedNotify(DccChatClient client)
 {
     if (ChatEstablished != null)
     {
         ChatEstablished(client);
     }
 }
Ejemplo n.º 4
0
 internal void RemoveChatClient(DccChatClient client)
 {
     if (chatCons.ContainsKey(client.User))
     {
         chatCons.Remove(client.User);
     }
 }
Ejemplo n.º 5
0
        internal void ChatMessageReceivedNotify(DccChatClient client, StringStream text)
        {
            if (ChatMessageReceived != null)
            {
                ChatMessageReceived(client, text);
            }

            if (m_irc.TriggersCommand(client.User, null, text))
            {
                m_irc.CommandHandler.Execute(new DccChatCmdTrigger(text, client.User));
            }
        }
Ejemplo n.º 6
0
 internal void AddChatClient(DccChatClient client)
 {
     if (chatCons.ContainsKey(client.User))
     {
         throw new ArgumentException(
                   "Chat already has been established",
                   "DccChatClient with " + client.User
                   );
     }
     else
     {
         chatCons.Add(client.User, client);
     }
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Sends a Dcc Chat request to the specified target and establishs a DccChatClient and a
        /// corresponding Listener with a custom timeout to listen for the incoming Chat Session.
        /// </summary>
        /// <param name="target">The nick of the user who should receive a file.</param>
        /// <param name="timeout">Specifies how long the listener should wait for an incoming receiver.</param>
        public DccChatClient Chat(string target, TimeSpan timeout, int port)
        {
            IrcUser user = m_irc.GetUser(target);

            if (user == null)
            {
                user = new IrcUser(m_irc, target);
            }
            var client = new DccChatClient(this, user, timeout, port);

            m_irc.CommandHandler.DccRequest(target,
                                            string.Format("CHAT \"chat\" {0} {1}",
                                                          Util.GetTcpAddress(Util.ExternalAddress),
                                                          client.Listener.LocalEndPoint.Port));
            return(client);
        }
Ejemplo n.º 8
0
 private void HandleChat(IrcUser user, string[] args)
 {
     try
     {
         long ip       = Convert.ToInt64(args[1]);
         int  port     = Convert.ToInt32(args[2]);
         var  endPoint = new IPEndPoint(Util.GetTcpAddress(ip), port);
         var  chatArgs = new DccChatArgs(user, endPoint);
         ChatRequestedNotify(chatArgs);
         if (chatArgs.Accept)
         {
             var client = new DccChatClient(this, user, endPoint);
         }
     }
     catch (Exception)
     {
         HandleInvalid(user, "CHAT", args);
     }
 }
Ejemplo n.º 9
0
 private void HandleChat(IrcUser user, string[] args)
 {
     try
     {
         long ip = Convert.ToInt64(args[1]);
         int port = Convert.ToInt32(args[2]);
         var endPoint = new IPEndPoint(Util.GetTcpAddress(ip), port);
         var chatArgs = new DccChatArgs(user, endPoint);
         ChatRequestedNotify(chatArgs);
         if (chatArgs.Accept)
         {
             var client = new DccChatClient(this, user, endPoint);
         }
     }
     catch (Exception)
     {
         HandleInvalid(user, "CHAT", args);
     }
 }
Ejemplo n.º 10
0
 internal void RemoveChatClient(DccChatClient client)
 {
     if (chatCons.ContainsKey(client.User))
         chatCons.Remove(client.User);
 }
Ejemplo n.º 11
0
        internal void ChatMessageReceivedNotify(DccChatClient client, StringStream text)
        {
            if (ChatMessageReceived != null)
                ChatMessageReceived(client, text);

            if (m_irc.TriggersCommand(client.User, null, text))
            {
                m_irc.CommandHandler.Execute(new DccChatCmdTrigger(text, client.User));
            }
        }
Ejemplo n.º 12
0
 internal void ChatFailedNotify(DccChatClient client, Exception ex)
 {
     if (ChatFailed != null)
         ChatFailed(client, ex);
 }
Ejemplo n.º 13
0
 internal void ChatEstablishedNotify(DccChatClient client)
 {
     if (ChatEstablished != null)
         ChatEstablished(client);
 }
Ejemplo n.º 14
0
 internal void ChatClosedNotify(DccChatClient client)
 {
     if (ChatClosed != null)
         ChatClosed(client);
 }
Ejemplo n.º 15
0
 internal void AddChatClient(DccChatClient client)
 {
     if (chatCons.ContainsKey(client.User))
         throw new ArgumentException(
             "Chat already has been established",
             "DccChatClient with " + client.User
             );
     else
         chatCons.Add(client.User, client);
 }
Ejemplo n.º 16
0
 /// <summary>
 /// Sends a Dcc Chat request to the specified target and establishs a DccChatClient and a 
 /// corresponding Listener with a custom timeout to listen for the incoming Chat Session.
 /// </summary>
 /// <param name="target">The nick of the user who should receive a file.</param>
 /// <param name="timeout">Specifies how long the listener should wait for an incoming receiver.</param>
 public DccChatClient Chat(string target, TimeSpan timeout, int port)
 {
     IrcUser user = m_irc.GetUser(target);
     if (user == null)
         user = new IrcUser(m_irc, target);
     var client = new DccChatClient(this, user, timeout, port);
     m_irc.CommandHandler.DccRequest(target,
                               string.Format("CHAT \"chat\" {0} {1}",
                                             Util.GetTcpAddress(Util.ExternalAddress),
                                             client.Listener.LocalEndPoint.Port));
     return client;
 }