internal void ChatClosedNotify(DccChatClient client) { if (ChatClosed != null) { ChatClosed(client); } }
internal void ChatFailedNotify(DccChatClient client, Exception ex) { if (ChatFailed != null) { ChatFailed(client, ex); } }
internal void ChatEstablishedNotify(DccChatClient client) { if (ChatEstablished != null) { ChatEstablished(client); } }
internal void RemoveChatClient(DccChatClient client) { if (chatCons.ContainsKey(client.User)) { chatCons.Remove(client.User); } }
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)); } }
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); } }
/// <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); }
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); } }
internal void RemoveChatClient(DccChatClient client) { if (chatCons.ContainsKey(client.User)) chatCons.Remove(client.User); }
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)); } }
internal void ChatFailedNotify(DccChatClient client, Exception ex) { if (ChatFailed != null) ChatFailed(client, ex); }
internal void ChatEstablishedNotify(DccChatClient client) { if (ChatEstablished != null) ChatEstablished(client); }
internal void ChatClosedNotify(DccChatClient client) { if (ChatClosed != null) ChatClosed(client); }
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); }
/// <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; }